/

CVE-2026-30950

Severity:

HIGH RISK

(7.1)

Broken Access Control / Insecure Direct Object Reference

CVE-2026-30950

Deferred

Vulnerability type

Category:

Broken Access Control / Insecure Direct Object Reference (IDOR)

CWE:

CWE-862

Impact:

Authenticated Session Hijacking and Data Exposure

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

AutoGPT versions 0.6.36 through 0.6.50 contain an authenticated session hijacking vulnerability caused by missing authorization checks on the session reassignment endpoint.

Any logged-in user who can guess or obtain another user's session_id can reassign that session to themselves, read its messages, and lock the original owner out.

Affected context

This vulnerability appears in AutoGPT's workflow automation platform where user sessions represent conversational or automation context.

The affected behavior centers on the PATCH /sessions/{session_id}/assign-user endpoint, which updates the owner of an existing session.

In the vulnerable versions, the endpoint performs authentication but does not confirm that the caller actually owns the target session, and the service layer passes user_id=None into the data access layer.

That None value is interpreted as a privileged/system lookup that bypasses ownership filtering, effectively granting broad access to any session identifier that an authenticated user can target.

Exploit preconditions

  • Attack surface: HTTP API endpoint PATCH /sessions/{session_id}/assign-user exposed to authenticated users.
  • Required access: Attacker must be an authenticated AutoGPT user with normal account privileges.
  • Knowledge required: Ability to obtain, predict, or enumerate a valid session_id for another user's session (through logging, side channels, or weak ID properties).
  • Trigger point: Sending a request to the assign-user endpoint with the victim's session_id, causing the backend to reassign that session to the attacker's account.
  • Why exploitation is possible: The service layer calls the data access layer with user_id=None, which is treated as a privileged/system context and bypasses ownership checks, so no per-session authorization validation occurs.

Why this happens

The root cause is a broken access control pattern in the session assignment logic, mapping to CWE-862: Missing Authorization.

While the API enforces that the caller is authenticated, it fails to enforce that the caller is authorized to modify the specific session resource referenced by session_id.

The design of the service and data access layers uses user_id=None as a special, privileged mode that returns sessions without filtering by owner.

By invoking session lookup with user_id=None for regular user requests, the code effectively implements an Insecure Direct Object Reference (IDOR): authorization is not re-checked on the specific object being manipulated.

Abstractly, the insecure pattern is: authenticate once at the endpoint, then perform object lookup or mutation in a context that bypasses per-object authorization constraints.

Potential impact

  • An authenticated user could hijack another user's active or historical sessions by reassigning ownership.
  • Attackers may read all messages and data associated with a victim's session, including potentially sensitive or proprietary information.
  • Victims can be locked out of their own sessions once reassigned, disrupting their workflows or investigations.
  • Compromised sessions could be used to manipulate or misconfigure automation workflows, leading to unintended actions or downstream data changes.
  • Repeated exploitation could undermine tenant isolation expectations and damage trust in the platform's security model.

General mitigation guidance

Effective mitigation focuses on enforcing strict, per-resource authorization and avoiding ambiguous "privileged" call paths in shared data access utilities.

Recommended defensive patterns include:

  • Enforce ownership checks at the service layer: For every operation that targets a session by session_id, verify that the current authenticated user is the owner (or is explicitly authorized) before allowing reassignment or access.
  • Avoid implicit privileged modes: Remove or constrain patterns where user_id=None or similar sentinel values trigger bypasses in the data access layer; privileged operations should use clearly separate code paths or roles.
  • Apply least privilege to API endpoints: Design endpoints such that they act only on resources naturally scoped to the current user (e.g., deriving session lists from the authenticated user context rather than arbitrary IDs).
  • Centralize authorization logic: Implement a reusable authorization checker or policy layer that evaluates resource ownership and roles consistently, rather than scattering ad-hoc checks across endpoints.
  • Harden identifier handling: Use session identifiers that are unguessable (e.g., cryptographically strong random IDs) and avoid exposing them unnecessarily in logs or URLs visible across tenants.
  • Defense-in-depth validation: Even after the primary fix, consider checking both at the service level and data access level that operations on sessions are constrained to the requesting user unless a well-defined admin capability is explicitly in use.

How teams detect issues like this

Detection for this type of vulnerability and abuse typically combines code-level analysis with runtime monitoring:

  • Static code review patterns:
  • Search for endpoints that accept direct resource identifiers (e.g., session_id) and mutate ownership or access without explicit authorization checks.
  • Flag data access calls that use sentinel values (such as user_id=None) to bypass filters, especially when invoked from user-facing API handlers.
  • Review service methods that change resource ownership or sharing permissions to ensure they always validate tenant boundaries and roles.
  • Static and SAST tools:
  • Configure static analysis tools to detect missing authorization checks on routes annotated as "authenticated".
  • Add custom rules that alert when object lookups for multi-tenant resources omit a current-user or tenant constraint.
  • Runtime and log-based detection:
  • Monitor logs for patterns where a single user repeatedly calls session assignment endpoints targeting many different session_id values.
  • Alert on sudden changes in session ownership, especially across distinct user accounts or tenants.
  • Track anomalies where a session's ownership changes without corresponding administrative activity.
  • Policy enforcement in CI/CD:
  • Require security reviews or automated checks for all new or modified endpoints that allow cross-user resource operations, such as reassigning ownership or transferring data.

Sources

SourceLink
github.comgithub.com/Significant-Gravitas/AutoGPT/commit/eca7b5e79370c34ed75e80badb824023d7d8629d
github.comgithub.com/Significant-Gravitas/AutoGPT/security/advisories/GHSA-q58p-v9r9-7gqj

Frequently asked

questions

Yes, if the AutoGPT deployment exposes its API externally. Any remote attacker with valid credentials and network access to the API can attempt to exploit this issue, provided they can obtain or guess valid session_id values.

No. The issue can be exploited by any authenticated user with normal privileges because the endpoint only checks that the caller is logged in, not that they own the target session.

The safest approach is to enforce strict authorization for every resource-level action: ensure that operations on sessions verify ownership or appropriate roles before allowing reassignment or access. Additionally, eliminate implicit privileged modes (such as using user_id=None to bypass filters) and separate administrative operations into clearly distinct, locked-down code paths.

Prevention relies on adopting a consistent access-control strategy: design APIs around resource ownership and tenancy boundaries, centralize authorization logic, and use code review checklists and static analysis rules to flag endpoints that accept arbitrary resource IDs without explicit authorization checks. Combining these practices with regular security testing and threat modeling for multi-tenant features reduces the likelihood of recurring IDOR-style vulnerabilities.

Find out what's already
exploitable in your codebase.