/

CVE-2026-56280

Severity:

HIGH RISK

(7.1)

Privilege Inversion (CWE-862) in Cap-go Build Logs API

CVE-2026-56280

Deferred

Vulnerability type

Category:

Authorization Bypass / Missing Authorization

CWE:

CWE-862

Impact:

Privilege Inversion leading to build disruption and CI/CD instability

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

A privilege inversion flaw in Cap-go's build logs endpoint lets holders of read-only API keys cancel running native builds simply by disconnecting from the log stream.

Because the server uses a highly privileged key without re-checking permissions, attackers can repeatedly disrupt build pipelines and CI/CD workflows by abusing a log-viewing interface.

Affected context

The vulnerability appears in Cap-go deployments that expose the GET /build/logs/:jobId Server-Sent Events (SSE) endpoint to clients with read-only API keys.

In affected versions, this endpoint registers an abort listener that unconditionally triggers build cancellation using a privileged server-side BUILDER_API_KEY.

Environments that rely on the explicit POST /build/cancel/:jobId endpoint and its app.build_native permission check may unknowingly have a second, less visible path to cancel builds whenever a log stream is opened and dropped.

Exploit preconditions

  • Attack surface: HTTPS API, specifically the GET /build/logs/:jobId SSE endpoint.
  • Required access: Possession of a valid read-only API key capable of accessing build logs, but not normally allowed to cancel builds.
  • Trigger point: Initiating a log stream to a running native build job and then disconnecting the SSE connection (e.g., closing the client, dropping the network, or programmatically aborting).
  • Why exploitation is possible: The abort listener tied to the SSE connection invokes cancelBuildOnDisconnect() using the privileged server-side BUILDER_API_KEY without performing the same app.build_native permission check enforced by the canonical POST /build/cancel/:jobId endpoint, effectively inverting the intended privilege model.

Why this happens

This issue stems from an authorization check mismatch between two different code paths that both cancel builds.

While the explicit cancellation API enforces an app.build_native permission on the caller, the log-streaming endpoint associates a disconnect event with automatic cancellation and executes it using a highly privileged server-side credential.

Because the disconnect-driven path does not re-evaluate the caller's permissions, read-only API key holders gain access to an effect (build cancellation) that should be reserved for more privileged roles.

This maps to CWE-862: Missing Authorization, where sensitive operations are reachable without the intended authorization checks, often due to hidden control flows such as callbacks, event handlers, or background listeners.

Potential impact

  • Attackers with read-only API keys could repeatedly cancel in-progress native builds.
  • CI/CD pipelines and automated release workflows may experience instability and unexpected failures.
  • Development teams could see delayed releases and decreased reliability of build infrastructure.
  • In multi-tenant setups, one tenant might interfere with another tenant's build operations if log access is mis-scoped.
  • Increased operational workload as teams attempt to diagnose and restart failed or canceled builds.

General mitigation guidance

Effective mitigation focuses on aligning authorization checks across all control paths that can affect build lifecycle:

  • Ensure that any code path capable of canceling a build, including disconnect handlers and internal utilities, performs the same permission checks as the primary cancellation API.
  • Avoid using privileged server-side credentials (such as BUILDER_API_KEY) to perform user-triggered actions without explicitly binding those actions to the caller's authorization context.
  • Treat logging and observability endpoints as potentially sensitive control surfaces; design them as strictly read-only and avoid coupling them with control-plane actions like cancel or restart.
  • Implement fine-grained role and permission models where "view logs" and "cancel build" are distinct, and structure APIs to enforce those distinctions consistently.
  • Where possible, adopt secure-by-default patterns such as requiring explicit, authenticated requests for destructive operations rather than inferring them from connection state.

How teams detect issues like this

Detection can combine code-centric and behavior-centric approaches:

  • Static analysis and code review: Look for event handlers or disconnect callbacks (e.g., onAbort, onDisconnect, SSE or WebSocket listeners) that invoke privileged operations without re-validating the caller's permissions.
  • Authorization consistency checks: During review, ensure that every way to reach a sensitive operation (like build cancellation) routes through a common authorization layer or shared service that enforces the same policy.
  • Logging and telemetry: Instrument build cancellation paths with detailed audit logs that include the originating endpoint, effective permissions, and identity context, then monitor for cancellations initiated from log or observability endpoints.
  • Security testing: Use automated tests or security scanners configured to exercise both the official control endpoints and ancillary interfaces (like log viewers) to detect privilege inconsistencies, including forced disconnects and abnormal termination flows.

Sources

SourceLink
github.comgithub.com/Cap-go/capgo/security/advisories/GHSA-95g7-xwwx-j737
vulncheck.comvulncheck.com/advisories/cap-go-privilege-inversion-in-build-log-stream-via-sse-disconnect

Frequently asked

questions

Yes, if the Cap-go API is exposed over the internet and an attacker obtains a read-only API key, they can trigger build cancellations remotely by connecting to and dropping the build log stream.

No. Exploitation specifically involves read-only API keys that are intended only for viewing logs; the flaw allows those low-privilege keys to indirectly cause build cancellations.

Unify authorization logic so all build cancellation actions, including those triggered by disconnect events or internal callbacks, must pass through the same permission checks as the main POST /build/cancel/:jobId endpoint, and remove or constrain the use of global privileged keys for user-driven operations.

Design systems so that sensitive actions are exposed only through a small set of well-audited endpoints, centralize authorization decisions in a common service or middleware, treat logging and observability features as read-only by default, and include tests and reviews that explicitly cover background events like disconnects and timeouts as potential triggers for state changes.

Find out what's already
exploitable in your codebase.