Summary
A path traversal flaw in Salvo's proxy component allows crafted URL paths containing ../ sequences to bypass routing constraints and reach unintended backend endpoints.
When exploited, an unauthenticated attacker can access protected or administrative paths on upstream services that should not be reachable through the proxy.
Affected context
This vulnerability appears in applications using the salvo-proxy component of the Salvo Rust web framework for routing and forwarding HTTP requests to upstream services.
It is particularly relevant where the proxy is meant to strictly control which backend paths are reachable (for example, exposing only specific APIs while hiding administrative or internal endpoints).
The issue manifests when the proxy relies on encode_url_path for composing or sanitizing upstream request paths and assumes that incoming path segments containing traversal sequences will be safely normalized.
Exploit preconditions
- Attack surface: Publicly exposed HTTP(S) endpoints handled by
salvo-proxy. - Required access: No authentication required; an external client can send arbitrary HTTP requests.
- Trigger point: Any route where user-controlled path components are forwarded by the proxy to an upstream server, and path-based access controls are enforced at the proxy layer.
- Why exploitation is possible: The
encode_url_pathfunction fails to normalize or safely encode../segments, because the.character is not re-encoded. As a result, traversal sequences can pass through the proxy largely unchanged, allowing requests to target backend paths that the proxy configuration intended to restrict.
Why this happens
The underlying bug is a path traversal vulnerability that stems from improper canonicalization and encoding of URL paths before forwarding them upstream.
The encode_url_path function is expected to produce a safe, encoded path representation, but it does not normalize or collapse ../ sequences and does not encode the . character, leaving traversal patterns intact.
In deployments where the proxy is treated as the primary enforcement point for which backend paths are reachable, this mismatch between expected and actual normalization behavior leads directly to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Abstractly, this represents an insecure pattern where user-controlled path segments are trusted and forwarded without robust normalization, allowing them to escape the intended logical routing scope.
Potential impact
- An attacker may reach internal or administrative endpoints that should not be exposed through the proxy.
- An attacker could access protected API routes that were assumed to be shielded by proxy-level path restrictions.
- An attacker can potentially bypass application-level access control that is enforced only on certain entry paths.
- An attacker may increase the blast radius of any downstream vulnerabilities by gaining reachability to more backend routes.
General mitigation guidance
Mitigations focus on robust path handling and defense-in-depth around routing and access control:
- Normalize and canonicalize URL paths before applying routing or access-control decisions, collapsing
.and..segments and rejecting paths that resolve outside the intended logical scope. - Treat user-supplied path segments as untrusted, and avoid composing upstream URLs directly from them without explicit validation against an allowlist or strict patterns.
- Use URL-encoding routines that avoid leaking raw traversal semantics (for example, by rejecting or re-encoding sequences that introduce directory navigation).
- Enforce authorization at the upstream application as well, not solely at the proxy layer, so that unexpected routing behavior does not automatically result in authorization bypass.
- Apply least-privilege routing rules, explicitly enumerating which upstream paths are allowed rather than relying on broad catch-all forwarding.
How teams detect issues like this
Effective detection typically combines code-centric and behavior-centric approaches:
- Static analysis / code review: Search for uses of
encode_url_path(or equivalent helpers) where user-controlled segments are appended to upstream paths without explicit normalization or validation. Flag any logic that assumes encoding alone will enforce path constraints. - Configuration review: Examine proxy routing rules for patterns that forward variable path segments (wildcards or captures) to upstream services while relying on path structure for access control.
- Dynamic testing / fuzzing: Use automated web scanners or bespoke scripts to send requests containing
../,..;, mixed encoded/decoded traversal patterns, and verify whether backend endpoints that should be hidden become reachable via the proxy. - Logging and monitoring: Enable detailed request logging at both proxy and upstream layers, and alert on anomalous paths containing traversal indicators or unexpected access to administrative routes.

