/

CVE-2026-121419

Severity:

HIGH RISK

(8.1)

Improper Authentication (CWE-269) in SurrealDB MCP Sessions

CVE-2026-121419

Deferred

Vulnerability type

Category:

Improper Authentication / Session Hijacking

CWE:

CWE-269

Impact:

MCP session hijacking and privilege escalation

Severity:

HIGH RISK

(8.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

SurrealDB can bind an MCP session to an access-method name rather than the identity of the individual JWT/Bearer user. If an attacker has a valid low-privilege token for that same access method and obtains a victim's mcp-session-id, they may hijack the session and invoke MCP tools with the victim's roles and permissions.

SurrealDB can bind an MCP session to an access-method name rather than the identity of the individual JWT/Bearer user. If an attacker has a valid low-privilege token for that same access method and obtains a victim's mcp-session-id, they may hijack the session and invoke MCP tools with the victim's roles and permissions.

Affected context

The issue affects SurrealDB MCP sessions using JWT/Bearer access methods in versions 3.1.0 before 3.3.0. The risk arises when session binding identifies users by the shared access-method name rather than by a per-user identity, allowing a token belonging to another user of that method to be treated as the session's bound subject.

The issue affects SurrealDB MCP sessions using JWT/Bearer access methods in versions 3.1.0 before 3.3.0. The risk arises when session binding identifies users by the shared access-method name rather than by a per-user identity, allowing a token belonging to another user of that method to be treated as the session's bound subject.

Exploit preconditions

  • Attack surface: MCP session handling in SurrealDB
  • Required access: A valid low-privilege JWT/Bearer token for the same access method used by the victim
  • Additional requirement: Access to the victim's mcp-session-id
  • Trigger point: Making MCP requests associated with the victim's session
  • Why exploitation is possible: The session fingerprint uses the access-method name instead of a per-user identity, so distinct users of that method may share the same binding.
  • Attack surface: MCP session handling in SurrealDB
  • Required access: A valid low-privilege JWT/Bearer token for the same access method used by the victim
  • Additional requirement: Access to the victim's mcp-session-id
  • Trigger point: Making MCP requests associated with the victim's session
  • Why exploitation is possible: The session fingerprint uses the access-method name instead of a per-user identity, so distinct users of that method may share the same binding.

Why this happens

The session-binding logic derives a BoundSubject fingerprint from the access-method name rather than the authenticated user's identity. This maps to CWE-269: Improper Privilege Management because authorization context can be associated with the wrong principal, allowing a lower-privilege user to act with the roles and permissions of a victim session.

The session-binding logic derives a BoundSubject fingerprint from the access-method name rather than the authenticated user's identity. This maps to CWE-269: Improper Privilege Management because authorization context can be associated with the wrong principal, allowing a lower-privilege user to act with the roles and permissions of a victim session.

Potential impact

  • An attacker may hijack a victim's MCP session.
  • MCP tools could be invoked with the victim's roles and permissions.
  • Sensitive data may be accessed or modified, depending on the victim's privileges and available tools.
  • Actions performed through the session could affect systems or resources available to the victim.
  • An attacker may hijack a victim's MCP session.
  • MCP tools could be invoked with the victim's roles and permissions.
  • Sensitive data may be accessed or modified, depending on the victim's privileges and available tools.
  • Actions performed through the session could affect systems or resources available to the victim.

General mitigation guidance

Defensive patterns focus on binding authenticated sessions to unique, verified principals and keeping authentication identity separate from access-method configuration.

  • Derive session bindings from a stable per-user identity, not a shared access-method name.
  • Verify that each request's authenticated principal matches the principal bound to its session.
  • Treat session identifiers as sensitive and limit their exposure and lifetime.
  • Apply least-privilege roles and permissions to users and MCP tools.
  • Use secure-by-default session handling that rejects ambiguous or mismatched identity bindings.

Defensive patterns focus on binding authenticated sessions to unique, verified principals and keeping authentication identity separate from access-method configuration.

  • Derive session bindings from a stable per-user identity, not a shared access-method name.
  • Verify that each request's authenticated principal matches the principal bound to its session.
  • Treat session identifiers as sensitive and limit their exposure and lifetime.
  • Apply least-privilege roles and permissions to users and MCP tools.
  • Use secure-by-default session handling that rejects ambiguous or mismatched identity bindings.

How teams detect issues like this

  • Review authentication and session-binding code for fingerprints derived from shared configuration identifiers instead of unique principal identities.
  • Use static analysis and code review checks to flag session authorization decisions that do not compare the authenticated user with the session owner.
  • Monitor for MCP sessions used with inconsistent principals or unexpected changes in the identity associated with a session.
  • Enforce policies requiring unique principal-to-session binding and least-privilege authorization for MCP tool access.
  • Review authentication and session-binding code for fingerprints derived from shared configuration identifiers instead of unique principal identities.
  • Use static analysis and code review checks to flag session authorization decisions that do not compare the authenticated user with the session owner.
  • Monitor for MCP sessions used with inconsistent principals or unexpected changes in the identity associated with a session.
  • Enforce policies requiring unique principal-to-session binding and least-privilege authorization for MCP tool access.

Sources

SourceLink
github.comgithub.com/surrealdb/surrealdb/security/advisories/GHSA-pgh9-49q4-hqcx
vulncheck.comvulncheck.com/advisories/surrealdb-3.1.0-before-3.3.0-mcp-session-hijack-via-boundsubject-collision

Frequently asked

questions

It concerns MCP session binding for JWT/Bearer access in affected SurrealDB versions. Exploitation depends on the access method and session requirements described above.

An attacker needs a valid low-privilege token for the same access method as the victim and access to the victim's mcp-session-id.

Bind each session to a unique, authenticated user identity and verify that identity on every request.

Keep session identity distinct from shared access configuration, enforce principal-to-session checks, protect session identifiers, and apply least privilege.

It concerns MCP session binding for JWT/Bearer access in affected SurrealDB versions. Exploitation depends on the access method and session requirements described above.

An attacker needs a valid low-privilege token for the same access method as the victim and access to the victim's mcp-session-id.

Bind each session to a unique, authenticated user identity and verify that identity on every request.

Keep session identity distinct from shared access configuration, enforce principal-to-session checks, protect session identifiers, and apply least privilege.

Find out what's already
exploitable in your codebase.