/

CVE-2026-107270

Severity:

HIGH RISK

(7.1)

IDOR (CWE-639) in Gophish Resource Management APIs

CVE-2026-107270

Deferred

Vulnerability type

Category:

Insecure Direct Object Reference

CWE:

CWE-639

Impact:

Unauthorized resource takeover, modification, and information disclosure

Severity:

HIGH RISK

(7.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Gophish through version 0.12.1 contains an insecure direct object reference vulnerability in APIs that manage groups, templates, landing pages, and sending profiles. An authenticated user may submit another user's sequential object identifier to overwrite or reassign resources, potentially locking out their owners and exposing recipient lists.

Gophish through version 0.12.1 contains an insecure direct object reference vulnerability in APIs that manage groups, templates, landing pages, and sending profiles. An authenticated user may submit another user's sequential object identifier to overwrite or reassign resources, potentially locking out their owners and exposing recipient lists.

Affected context

The vulnerability occurs in Gophish deployments where authenticated users can access resource-management endpoints without sufficiently enforcing ownership or authorization for the referenced object. Affected API areas include groups, templates, landing pages, and SMTP sending profiles, particularly when object identifiers are sequential and accepted directly from client requests.

The vulnerability occurs in Gophish deployments where authenticated users can access resource-management endpoints without sufficiently enforcing ownership or authorization for the referenced object. Affected API areas include groups, templates, landing pages, and SMTP sending profiles, particularly when object identifiers are sequential and accepted directly from client requests.

Exploit preconditions

  • Attack surface: Authenticated HTTP API endpoints
  • Required access: A valid Gophish user account with access to the relevant API functionality
  • Trigger point: POST requests to resource-management endpoints such as /api/groups/, /api/templates/, /api/pages/, or /api/smtp/
  • Why exploitation is possible: The application may rely on a user-supplied sequential identifier without verifying that the authenticated user owns or is authorized to modify the referenced object
  • Attack surface: Authenticated HTTP API endpoints
  • Required access: A valid Gophish user account with access to the relevant API functionality
  • Trigger point: POST requests to resource-management endpoints such as /api/groups/, /api/templates/, /api/pages/, or /api/smtp/
  • Why exploitation is possible: The application may rely on a user-supplied sequential identifier without verifying that the authenticated user owns or is authorized to modify the referenced object

Why this happens

The underlying bug is an authorization failure in object-level access control. The application accepts a direct object reference from an authenticated client and performs an update or reassignment without consistently checking whether that object belongs to the requesting user or is otherwise within the user's permitted scope. This behavior maps to CWE-639: Authorization Bypass Through User-Controlled Key, commonly associated with insecure direct object references.

The underlying bug is an authorization failure in object-level access control. The application accepts a direct object reference from an authenticated client and performs an update or reassignment without consistently checking whether that object belongs to the requesting user or is otherwise within the user's permitted scope. This behavior maps to CWE-639: Authorization Bypass Through User-Controlled Key, commonly associated with insecure direct object references.

Potential impact

  • An attacker may overwrite or reassign another user's groups, templates, landing pages, or sending profiles.
  • Resource owners could be locked out of objects they previously controlled.
  • Recipient lists or other campaign-related information could be exposed.
  • Campaign configuration may be altered, causing operational disruption or unauthorized phishing activity.
  • The integrity of stored Gophish resources could be compromised.
  • An attacker may overwrite or reassign another user's groups, templates, landing pages, or sending profiles.
  • Resource owners could be locked out of objects they previously controlled.
  • Recipient lists or other campaign-related information could be exposed.
  • Campaign configuration may be altered, causing operational disruption or unauthorized phishing activity.
  • The integrity of stored Gophish resources could be compromised.

General mitigation guidance

Mitigation generally centers on enforcing server-side object-level authorization for every resource operation.

Common defensive patterns include:

  • Deriving the permitted owner or tenant scope from the authenticated session rather than trusting client-provided ownership data.
  • Checking authorization immediately before every read, update, reassignment, or deletion operation.
  • Using opaque, non-sequential identifiers as a defense-in-depth measure, without treating them as a replacement for authorization.
  • Applying least-privilege roles and limiting access to campaign-management APIs.
  • Returning generic authorization failures without revealing whether another user's object exists.
  • Separating administrative resource operations from ordinary user workflows and requiring explicit elevated privileges where appropriate.

Mitigation generally centers on enforcing server-side object-level authorization for every resource operation.

Common defensive patterns include:

  • Deriving the permitted owner or tenant scope from the authenticated session rather than trusting client-provided ownership data.
  • Checking authorization immediately before every read, update, reassignment, or deletion operation.
  • Using opaque, non-sequential identifiers as a defense-in-depth measure, without treating them as a replacement for authorization.
  • Applying least-privilege roles and limiting access to campaign-management APIs.
  • Returning generic authorization failures without revealing whether another user's object exists.
  • Separating administrative resource operations from ordinary user workflows and requiring explicit elevated privileges where appropriate.

How teams detect issues like this

Detection can combine code review, automated analysis, and runtime monitoring:

  • Search for API handlers that use client-supplied identifiers in database queries or update operations.
  • Review whether each object access includes an ownership, tenant, role, or policy check tied to the authenticated identity.
  • Flag authorization checks that occur only at route level rather than at the individual object level.
  • Test requests using identifiers belonging to different users and verify consistent authorization failures.
  • Monitor audit logs for unusual cross-user resource updates, reassignment attempts, or repeated sequential identifier access.
  • Use static analysis and automated API security testing to identify missing object-level authorization controls.

Detection can combine code review, automated analysis, and runtime monitoring:

  • Search for API handlers that use client-supplied identifiers in database queries or update operations.
  • Review whether each object access includes an ownership, tenant, role, or policy check tied to the authenticated identity.
  • Flag authorization checks that occur only at route level rather than at the individual object level.
  • Test requests using identifiers belonging to different users and verify consistent authorization failures.
  • Monitor audit logs for unusual cross-user resource updates, reassignment attempts, or repeated sequential identifier access.
  • Use static analysis and automated API security testing to identify missing object-level authorization controls.

Sources

SourceLink
blog.ostorlab.coblog.ostorlab.co/gophish-0121-manual-review-agentic-deep-scan.html
github.comgithub.com/gophish/gophish
github.comgithub.com/gophish/gophish/blob/b1648f0759c6d57ac989157c55d8b47c40254fe6/controllers/api/group.go#L28-L43
github.comgithub.com/gophish/gophish/blob/b1648f0759c6d57ac989157c55d8b47c40254fe6/models/group.go#L194-L200
vulncheck.comvulncheck.com/advisories/gophish-through-0.12.1-object-takeover-via-client-supplied-id-on-api-create-endpoints

Frequently asked

questions

It may be exploitable through the Gophish API by an authenticated user who can reach the affected endpoints. The attacker generally does not need unauthenticated network access, but deployment exposure and account permissions determine practical reachability.

A valid authenticated account with access to the relevant resource-management functionality is typically required. The account may not need to own the targeted object if object-level authorization is missing.

Enforce server-side ownership or policy checks for every object referenced by an API request. Do not rely on sequential identifiers, hidden fields, or client-supplied ownership values as authorization controls.

Apply centralized authorization middleware or policy checks, use least-privilege roles, add cross-user access tests to API security testing, and maintain audit logging for sensitive resource modifications.

It may be exploitable through the Gophish API by an authenticated user who can reach the affected endpoints. The attacker generally does not need unauthenticated network access, but deployment exposure and account permissions determine practical reachability.

A valid authenticated account with access to the relevant resource-management functionality is typically required. The account may not need to own the targeted object if object-level authorization is missing.

Enforce server-side ownership or policy checks for every object referenced by an API request. Do not rely on sequential identifiers, hidden fields, or client-supplied ownership values as authorization controls.

Apply centralized authorization middleware or policy checks, use least-privilege roles, add cross-user access tests to API security testing, and maintain audit logging for sensitive resource modifications.

Find out what's already
exploitable in your codebase.