Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-56306

CVE-2026-56306: Capgo Auth Bypass Vulnerability

CVE-2026-56306 is an authentication bypass vulnerability in Capgo before 12.128.2 that allows attackers to bypass subkey enforcement via malformed header values. This article covers technical details, affected versions, and mitigation.

Published:

CVE-2026-56306 Overview

CVE-2026-56306 affects Capgo versions before 12.128.2. The vulnerability stems from weak parsing of the x-limited-key-id HTTP header, which controls subkey scope enforcement. Attackers can submit malformed values, zero, or duplicate headers that resolve to NaN or falsy values. When this occurs, Capgo bypasses subkey enforcement and processes requests using the main API key context instead of the restricted subkey permissions.

The flaw maps to CWE-20: Improper Input Validation. Remote attackers with low privileges can leverage the bypass to gain access beyond their intended scope.

Critical Impact

Authenticated attackers can disable limited key scoping and execute API requests with main API key privileges, breaking the principle of least privilege enforced by subkeys.

Affected Products

  • Capgo versions prior to 12.128.2
  • Self-hosted Capgo deployments using subkey-based API access control
  • Applications relying on x-limited-key-id header enforcement for scoped permissions

Discovery Timeline

  • 2026-06-22 - CVE-2026-56306 published to NVD
  • 2026-06-23 - Last updated in NVD database

Technical Details for CVE-2026-56306

Vulnerability Analysis

Capgo implements subkey-based authorization to restrict API operations beyond what the main API key permits. The x-limited-key-id HTTP header identifies which subkey context applies to a given request. The server parses this header value and applies the associated permission scope to gate subsequent operations.

The parser does not strictly validate the header value before coercing it to a numeric identifier. Submitting non-numeric strings, the literal value 0, or duplicate x-limited-key-id headers produces NaN or falsy results during type coercion. The downstream authorization check treats these falsy outcomes as the absence of a subkey, which causes Capgo to fall back to the main API key context.

The bypass converts a scoped, low-privilege request into one executed under the full permission set of the parent API key. This allows the caller to perform operations that the subkey was explicitly designed to prohibit.

Root Cause

The root cause is improper input validation [CWE-20] in the x-limited-key-id header handler. The implementation relies on truthy-value checks after type coercion rather than rejecting malformed, zero, or duplicate header values. JavaScript and similar runtimes return NaN for non-numeric coercions and treat NaN and 0 as falsy, which the authorization logic interprets as "no subkey supplied."

Attack Vector

The attack vector is network-based and requires only low-privilege authentication, namely possession of a valid subkey. An attacker sends an API request with the subkey credentials but supplies a malformed, zero, or duplicated x-limited-key-id header. The server fails the subkey lookup, defaults to main key context, and executes the request with elevated permissions.

No verified exploit code is published. See the GitHub Security Advisory GHSA-42vv-8j94-24wj and the VulnCheck Advisory on Subkey Bypass for technical details.

Detection Methods for CVE-2026-56306

Indicators of Compromise

  • API requests containing x-limited-key-id headers with non-numeric, empty, or zero values
  • Requests presenting duplicate x-limited-key-id headers in a single HTTP transaction
  • Subkey-authenticated sessions performing operations outside the subkey's declared scope
  • Successful API calls to privileged endpoints that should be inaccessible to the requesting subkey

Detection Strategies

  • Inspect web server and reverse proxy access logs for malformed or duplicated x-limited-key-id headers
  • Correlate subkey identifiers in authentication events with the operations executed under those sessions to identify scope violations
  • Alert on API responses returning resources or actions that exceed the requesting subkey's permission profile

Monitoring Recommendations

  • Enable verbose logging on the Capgo API gateway to capture full request headers and the resolved authorization context
  • Forward API access logs to a centralized analytics platform and build queries for x-limited-key-id anomalies
  • Track the ratio of subkey-authenticated requests to main-key-authenticated requests over time and investigate sudden shifts

How to Mitigate CVE-2026-56306

Immediate Actions Required

  • Upgrade Capgo to version 12.128.2 or later, which contains the corrected header parsing logic
  • Rotate all main API keys and subkeys that may have been exposed to potentially abused subkey contexts
  • Audit recent API activity for operations executed outside the expected subkey scope

Patch Information

The maintainer addressed the issue in Capgo release 12.128.2. The fix enforces strict validation of the x-limited-key-id header, rejecting non-numeric, zero, and duplicate values rather than coercing them to falsy states. Refer to the GitHub Security Advisory GHSA-42vv-8j94-24wj for the upstream commit details.

Workarounds

  • Deploy a reverse proxy or WAF rule that rejects requests where x-limited-key-id is missing, empty, non-numeric, or duplicated when subkey credentials are presented
  • Restrict subkey permissions to the minimum required and avoid issuing subkeys with sensitive scopes until the patched version is deployed
  • Temporarily disable subkey issuance and require main API key authentication with stricter network-level access controls until upgrade is complete

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.