Severity:

HIGH RISK

(8.2)

Authorization Bypass / Insecure Direct Object Reference

CVE-2026-8890

Deferred

Vulnerability type

Category:

Authorization Bypass / Insecure Direct Object Reference

CWE:

CWE-639

Impact:

User Impersonation and Unauthorized Data Access

Severity:

HIGH RISK

(8.2)

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

The code100x Mobile API contains an authorization bypass issue that lets attackers impersonate any user by crafting a JSON payload in a special HTTP header.

Because the middleware trusts a spoofed identity header whenever an Auth-Key header is present without validating its value, unauthenticated attackers can gain access to course data belonging to arbitrary users and administrators.

Affected context

This vulnerability affects the mobile API path where requests pass through middleware.ts and then into the mobile courses endpoint.

It is relevant in deployments where:

  • The Mobile API accepts HTTP requests with custom headers such as Auth-Key and g
  • The middleware is responsible for generating and attaching identity headers
  • Downstream route handlers trust the identity header for access control decisions

Exploit preconditions

  • Attack surface: Public-facing Mobile API endpoints exposed over HTTP(S)
  • Required access: Network access to the API; no valid credentials needed
  • Trigger point: Sending a request with:
  • A crafted g HTTP header containing a JSON payload that encodes a victim user identity
  • An Auth-Key header (with any value) that causes the middleware to skip identity header generation
  • Why exploitation is possible: The middleware logic treats the presence of Auth-Key as sufficient for bypassing identity construction yet does not validate the Auth-Key value.

Consequently, downstream handlers treat the attacker-supplied identity header as trustworthy and use it for authorization decisions.

Why this happens

The underlying issue is an authorization design flaw mapped to CWE-639: Authorization Bypass Through User-Controlled Key.

Instead of deriving user identity from an authenticated context, the system:

  • Suppresses normal identity header generation whenever an Auth-Key header exists, regardless of its validity, and
  • Relies on a caller-controlled header (g with JSON) to provide identity information that downstream logic treats as authoritative.

This pattern allows untrusted input to control the identifier used in authorization checks, effectively turning a user identifier into an attacker-controlled key for access control.

Potential impact

  • Unauthorized access to course data for any enrolled user
  • Impersonation of administrator accounts within the Mobile API context
  • Exposure of sensitive user information such as enrollment status or course progress
  • Potential pivot into administrative actions if the impersonated identity has elevated privileges
  • Loss of audit trail integrity, as activity appears to originate from impersonated users

General mitigation guidance

Effective mitigation focuses on centralizing and hardening identity derivation and removing attacker influence from authorization keys:

  • Ensure that user identity is derived only from validated authentication artifacts (e.g., session tokens, signed tokens, or securely validated API keys).
  • Treat all client-supplied identity- or role-related headers as untrusted; generate identity headers exclusively on the server side.
  • Validate any Auth-Key or API key against a secure backend store and reject requests with missing, malformed, or invalid values instead of skipping checks.
  • Enforce authorization decisions based on internal user IDs or subject claims that cannot be directly manipulated by clients.
  • Apply least-privilege design so that even if identity handling fails, exposed data sets are minimized.
  • Normalize and document header usage so that security-relevant headers are not overloaded with multiple meanings or ambiguous behavior.

How teams detect issues like this

Detection approaches can focus on both code-level and runtime signals:

  • Static analysis / code review:
  • Look for middleware that branches on the presence of headers like Auth-Key without verifying their contents or provenance.
  • Flag patterns where user identity or role is derived directly from request headers or request body fields without cryptographic verification.
  • Identify routes where authorization decisions are tied to IDs or identity attributes that originate from client-controlled values.
  • Policy enforcement:
  • Define internal guidelines that prohibit trusting client-provided identity headers and require server-side identity generation.
  • Use automated review tools to enforce rules around header-based authentication and authorization logic.
  • Runtime monitoring:
  • Log and alert on anomalous use of Auth-Key and identity headers, especially repeated access to multiple accounts from a single source.
  • Monitor for patterns where a single client accesses many distinct user or admin identities in a short timeframe.

Sources

SourceLink
github.comgithub.com/code100x/cms/issues/1924
github.comgithub.com/code100x/cms/pull/1927
github.comgithub.com/code100x/cms/pull/1927/changes/88c6c5e94e23da101235c4c7e9c7591ac1016549
github.comgithub.com/code100x/cms/pull/1927/changes/90b489ee7c63c301107d6374d4b3f2b8e4060fe5
vulncheck.comvulncheck.com/advisories/code100x-mobile-api-authentication-bypass-via-header-spoofing

Frequently asked

questions

Yes. Any party that can send HTTP requests to the exposed Mobile API can attempt to exploit this issue by crafting the relevant headers; no prior authentication is required.

Only basic network access to the Mobile API endpoint is needed. The attacker does not need a valid Auth-Key value because the logic currently checks only for the header's presence, not its validity.

Centralize identity and authorization logic in the server, validate Auth-Key or other authentication tokens against a trusted store, and ignore any client-supplied identity headers. Downstream handlers should rely solely on server-generated identity context, not on values derived directly from request headers like g.

Adopt a consistent access control design where user identifiers used in authorization are never directly influenced by client input, enforce strict validation of all authentication-related headers or tokens, and include explicit checks for header-based trust assumptions in security code reviews and automated analysis.

Find out what's already
exploitable in your codebase.