/

CVE-2026-119707

Severity:

HIGH RISK

(7.1)

Missing Authorization (CWE-862) in SonicJS API Routes

CVE-2026-119707

Deferred

Vulnerability type

Category:

Missing Authorization

CWE:

CWE-862

Impact:

Unauthorized document modification and publication

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

SonicJS API write routes rely on broad role labels without consistently enforcing document-level authorization. An authenticated author or editor with a valid bearer JWT or API key may therefore create, modify, publish, or soft-delete documents owned by other users, including documents protected by administrator deny overrides.

SonicJS API write routes rely on broad role labels without consistently enforcing document-level authorization. An authenticated author or editor with a valid bearer JWT or API key may therefore create, modify, publish, or soft-delete documents owned by other users, including documents protected by administrator deny overrides.

Affected context

The issue occurs in SonicJS deployments where the /api/:collection or /api/content write routes are exposed to authenticated users and authorization decisions stop at coarse role checks. Risk is higher when authors or editors can reach these routes and document-level ACLs or administrator deny rules are expected to constrain their actions.

The issue occurs in SonicJS deployments where the /api/:collection or /api/content write routes are exposed to authenticated users and authorization decisions stop at coarse role checks. Risk is higher when authors or editors can reach these routes and document-level ACLs or administrator deny rules are expected to constrain their actions.

Exploit preconditions

  • Attack surface: The /api/:collection and /api/content write routes
  • Required access: An authenticated account with an accepted bearer JWT or API key
  • Trigger point: A create, update, publish, or soft-delete request targeting another user's document
  • Why exploitation is possible: Route authorization validates broad role labels without reliably enforcing document ownership, ACLs, or administrator deny overrides
  • Attack surface: The /api/:collection and /api/content write routes
  • Required access: An authenticated account with an accepted bearer JWT or API key
  • Trigger point: A create, update, publish, or soft-delete request targeting another user's document
  • Why exploitation is possible: Route authorization validates broad role labels without reliably enforcing document ownership, ACLs, or administrator deny overrides

Why this happens

The underlying flaw is an authorization design that treats coarse-grained roles as sufficient for operations requiring resource-level decisions. Because the write paths do not consistently evaluate the target document's owner, ACL, and explicit deny rules, users with otherwise legitimate access can perform actions outside their permitted scope. This maps to CWE-862: Missing Authorization.

The underlying flaw is an authorization design that treats coarse-grained roles as sufficient for operations requiring resource-level decisions. Because the write paths do not consistently evaluate the target document's owner, ACL, and explicit deny rules, users with otherwise legitimate access can perform actions outside their permitted scope. This maps to CWE-862: Missing Authorization.

Potential impact

  • Unauthorized users may modify or delete other users' documents
  • Attackers could publish unapproved or malicious content
  • Content integrity and workflow controls may be bypassed
  • Administrative deny overrides may be ineffective
  • The application could experience data loss, defacement, or reputational harm
  • Unauthorized users may modify or delete other users' documents
  • Attackers could publish unapproved or malicious content
  • Content integrity and workflow controls may be bypassed
  • Administrative deny overrides may be ineffective
  • The application could experience data loss, defacement, or reputational harm

General mitigation guidance

Mitigation generally focuses on enforcing authorization at the resource and operation level rather than relying only on role labels.

Common defensive patterns include:

  • Centralizing authorization checks for every create, update, publish, and delete operation
  • Evaluating document ownership, ACLs, tenant boundaries, and explicit deny rules before allowing writes
  • Applying deny-by-default behavior when authorization context is missing or ambiguous
  • Separating content-management privileges from publication and deletion privileges
  • Reducing trust in bearer tokens and API keys by validating scope, audience, identity, and intended operation
  • Running service identities with only the permissions required for their assigned workflows

Mitigation generally focuses on enforcing authorization at the resource and operation level rather than relying only on role labels.

Common defensive patterns include:

  • Centralizing authorization checks for every create, update, publish, and delete operation
  • Evaluating document ownership, ACLs, tenant boundaries, and explicit deny rules before allowing writes
  • Applying deny-by-default behavior when authorization context is missing or ambiguous
  • Separating content-management privileges from publication and deletion privileges
  • Reducing trust in bearer tokens and API keys by validating scope, audience, identity, and intended operation
  • Running service identities with only the permissions required for their assigned workflows

How teams detect issues like this

Organizations can detect authorization gaps through:

  • Static analysis and code review checks for write handlers that inspect roles but not resource ownership or ACLs
  • Tests covering cross-user create, update, publish, and soft-delete attempts
  • Authorization matrix testing for every role, document state, and deny override combination
  • API gateway or policy enforcement that requires explicit operation and resource scopes
  • Audit-log monitoring for changes made by users outside the document's ownership or permitted ACL
  • Automated security review tools that identify missing authorization checks in route handlers

Organizations can detect authorization gaps through:

  • Static analysis and code review checks for write handlers that inspect roles but not resource ownership or ACLs
  • Tests covering cross-user create, update, publish, and soft-delete attempts
  • Authorization matrix testing for every role, document state, and deny override combination
  • API gateway or policy enforcement that requires explicit operation and resource scopes
  • Audit-log monitoring for changes made by users outside the document's ownership or permitted ACL
  • Automated security review tools that identify missing authorization checks in route handlers

Sources

SourceLink
github.comgithub.com/SonicJs-Org/sonicjs
github.comgithub.com/SonicJs-Org/sonicjs/blob/v3.0.0/packages/core/src/routes/api.ts#L1296
github.comgithub.com/SonicJs-Org/sonicjs/issues/1125
github.comgithub.com/SonicJs-Org/sonicjs/pull/1147
hackmd.iohackmd.io/@hieuPenguinnn/sonicjs-content-api-write-acl-bypass
vulncheck.comvulncheck.com/advisories/sonicjs-through-3.0.0-missing-authorization-in-content-write-api

Frequently asked

questions

Yes, when the affected API routes are network-accessible and an attacker has valid credentials accepted by the application. Exploitation does not require administrative privileges if an author or editor account is sufficient.

The attacker generally needs an authenticated bearer JWT or API key associated with a role allowed to reach the write routes. The flaw then permits actions beyond the permissions intended for that role.

Enforce centralized, deny-by-default authorization for each operation and target document. Checks should evaluate ownership, ACLs, document state, and administrator deny overrides before performing the write.

Maintain an explicit authorization matrix, test every write operation across roles and resource owners, minimize token scopes, and monitor audit logs for cross-user content changes.

Yes, when the affected API routes are network-accessible and an attacker has valid credentials accepted by the application. Exploitation does not require administrative privileges if an author or editor account is sufficient.

The attacker generally needs an authenticated bearer JWT or API key associated with a role allowed to reach the write routes. The flaw then permits actions beyond the permissions intended for that role.

Enforce centralized, deny-by-default authorization for each operation and target document. Checks should evaluate ownership, ACLs, document state, and administrator deny overrides before performing the write.

Maintain an explicit authorization matrix, test every write operation across roles and resource owners, minimize token scopes, and monitor audit logs for cross-user content changes.

Find out what's already
exploitable in your codebase.