Summary
Capgo versions prior to 12.128.2 contain a path traversal flaw in the builder upload proxy that lets authenticated users with build permissions bypass intended upload path restrictions.
By appending traversal sequences that are normalized by the WHATWG URL parser, an attacker can reach internal administrative endpoints using the privileged BUILDER_API_KEY header, leading to server-side privilege escalation.
Affected context
This vulnerability arises in Capgo deployments where the builder upload proxy accepts user-controlled paths from authenticated builders and relies on URL normalization to construct internal request targets.
It becomes relevant when traversal sequences such as ../ are not fully sanitized before being processed by the WHATWG URL parser, and when the same proxy can access internal administrative endpoints using high-privilege headers.
Exploit preconditions
- Attack surface: HTTP(S) interface of the Capgo builder upload proxy
- Required access: Authenticated user account with build permissions and the ability to submit uploads
- Trigger point: Submission of crafted upload requests containing path traversal sequences in the upload path
- Why exploitation is possible: The proxy trusts normalized paths produced by the WHATWG URL parser without enforcing strict path constraints, allowing traversal out of the intended upload directory to internal admin endpoints that are invoked with a privileged BUILDER_API_KEY header
Why this happens
The core issue is improper restriction of file and resource paths derived from user input, mapping directly to CWE-22: Path Traversal.
The builder upload proxy composes backend URLs from user-supplied path fragments and relies on WHATWG URL normalization, but does not apply robust validation to ensure paths remain within allowed upload scopes.
As a result, traversal tokens are resolved into effective paths that can point to internal administrative endpoints, and the proxy forwards requests with elevated headers, unintentionally granting higher privileges to a lower-privileged client.
Potential impact
- Authenticated users may gain access to internal administrative endpoints
- Attackers could perform actions reserved for higher-privileged roles or service accounts
- Configuration or metadata related to builds and deployments could be modified or exfiltrated
- Further compromise of server-side components through misuse of the BUILDER_API_KEY privileges
General mitigation guidance
Effective mitigation focuses on constraining path handling and reducing implicit trust in normalized URLs.
Common defensive patterns include:
- Enforcing strict allowlists or route-based mapping for upload paths and backend endpoints instead of directly using user-supplied path segments
- Normalizing paths and then explicitly checking that the resolved path remains within an expected base directory or scope before processing
- Separating internal administrative APIs from user-facing proxies to avoid privilege leakage through shared headers
- Applying least-privilege principles to service headers and API keys so that builder-related credentials cannot perform unrelated administrative operations
- Implementing centralized validation utilities for path and URL handling to avoid inconsistent checks across the codebase
How teams detect issues like this
Organizations can identify similar vulnerabilities by:
- Using static analysis rules that flag concatenation of user-controlled path segments with internal URLs or filesystem locations
- Reviewing proxy and routing code for any use of path normalization without subsequent boundary checks (e.g., ensuring paths stay within a configured base)
- Inspecting use of privileged headers and API keys to confirm they are never attached to requests derived from user-controllable input
- Implementing logging and anomaly detection for requests targeting internal endpoints from user-facing components, such as builder upload proxies
- Applying security-focused code review checklists that explicitly cover CWE-22 risks around URL and path handling

