Summary
A path traversal flaw in the zrok Python SDK ProxyShare Flask route allows an attacker-controlled absolute URL in the request path to override the configured proxy target.
When exploited, the proxy makes server-side HTTP requests to attacker-chosen URLs, enabling server-side request forgery and exposure of internal services whenever the proxy is reachable.
Affected context
This vulnerability appears in deployments using the zrok Python SDK's ProxyShare functionality with the Flask proxy route enabled.
The issue arises when the route accepts arbitrary absolute URLs as part of the request path and combines them using urllib.parse.urljoin without constraining the resulting destination.
Environments where the proxy has network access to internal or privileged endpoints (e.g., cloud metadata services, internal APIs, administrative interfaces) are more exposed.
Exploit preconditions
- Attack surface: HTTP interface of the ProxyShare Flask route.
- Required access: Ability to send crafted requests to the proxy route (typically remote or network-local access).
- Trigger point: Supplying an absolute URL within the request path that
urljoinuses to override the configured upstream host. - Why exploitation is possible: The proxy trusts the path component to construct the outbound URL, allowing an attacker-controlled absolute URL to bypass the intended target and redirect the server-side request to an arbitrary endpoint.
Why this happens
The root cause is improper canonicalization and validation of the request path when building the proxied URL.
The ProxyShare route uses urllib.parse.urljoin with user-supplied path data, permitting absolute URLs in the path to override the configured upstream host.
This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, generalized here as failing to restrict how user-controlled path or URL components influence resource resolution.
At a higher level, it is a URL construction bug where trust is incorrectly placed in unvalidated request path elements that control server-side network requests.
Potential impact
- Attacker can cause the proxy to make HTTP requests to arbitrary external URLs.
- Attacker may probe and access internal services reachable only from the proxy host.
- Attacker could attempt to exfiltrate data from cloud metadata endpoints or internal APIs.
- Attacker can leverage SSRF for further compromise depending on the internal network architecture.
- Logging and monitoring data may be polluted with attacker-driven request patterns.
General mitigation guidance
Effective mitigation focuses on restricting how user input influences target URLs and applying strict destination controls.
Recommended patterns include:
- Construct outbound URLs using fixed, trusted hosts and only append sanitized relative paths.
- Reject or normalize any absolute URLs in request paths before URL construction.
- Enforce an allowlist of permissible upstream hosts or endpoint paths for proxy requests.
- Apply least-privilege network controls so proxy processes have minimal access to internal or sensitive services.
- Introduce input validation and canonicalization layers that ensure paths stay within expected scopes and do not carry protocol or host components.
How teams detect issues like this
Detection commonly involves:
- Static analysis or linters that flag uses of URL construction APIs (
urljoin,requests, etc.) with unvalidated user-controlled input. - Code review practices focused on proxying logic, verifying that hosts are not derived from request paths or query parameters.
- Runtime monitoring for unusual outbound traffic patterns from proxy services, such as requests to internal IP ranges or cloud metadata endpoints.
- Policy-based checks in CI/CD pipelines enforcing that proxy components must use fixed upstream hosts and perform explicit validation of path segments.

