/

CVE-2026-120213

Severity:

CRITICAL RISK

(9.1)

Path Restriction Bypass (CWE-22) in @fastify/http-proxy

CVE-2026-120213

Awaiting Analysis

Vulnerability type

Category:

Path Restriction Bypass

CWE:

CWE-22, CWE-436

Impact:

Upstream path restriction bypass, potentially leading to SSRF or authorization bypass

Severity:

CRITICAL RISK

(9.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

In affected @fastify/http-proxy configurations, decoded route parameters can alter the upstream path beyond the prefix intended by the application. An unauthenticated remote attacker may reach unintended upstream locations, potentially enabling SSRF or bypassing authorization in the proxied service.

Affected context

The issue affects applications using @fastify/http-proxy versions 9.0.0 through 11.6.5 with parameterized prefix and rewritePrefix options. It becomes risky when decoded route parameters are incorporated into the rewritten upstream URL without safe encoding, and the upstream relies on the configured path prefix to limit access.

Exploit preconditions

  • Attack surface: An HTTP route exposed through the proxy
  • Required access: No authentication is required when the affected route is publicly reachable
  • Trigger point: Processing a request whose route parameters are substituted into rewritePrefix
  • Why exploitation is possible: Decoded separators and URL delimiters can change the resulting upstream path and remove an intended suffix or path constraint

Why this happens

The underlying issue is inconsistent interpretation of URL components: parameter values are URL-decoded and then inserted into a rewritten path without being re-encoded. This can turn data treated as a route parameter into meaningful path, query, or fragment delimiters. It relates to CWE-22: Improper Limitation of a Pathname to a Restricted Directory and CWE-436: Interpretation Conflict, because the proxy and upstream may interpret the resulting URL differently.

Potential impact

  • An attacker may reach upstream paths outside the intended prefix
  • The proxy may expose upstream functionality that was meant to be restricted
  • Depending on upstream behavior, requests could enable server-side request forgery
  • Authorization controls in a proxied service could be bypassed

General mitigation guidance

Defensive patterns focus on preserving path boundaries and avoiding trust in decoded route parameters when constructing upstream URLs.

  • Prefer fixed, explicitly allowlisted upstream paths over user-influenced path construction
  • Encode parameter values appropriately for the URL component where they are used
  • Validate route parameters against narrow, expected character sets and formats
  • Enforce upstream authorization independently of proxy path restrictions
  • Treat proxy path rewriting as a security boundary and test that unexpected delimiters cannot change the destination

The vulnerability description identifies no workaround other than using a fixed release; configuration-only controls should not be assumed to fully address it.

How teams detect issues like this

  • Review proxy configuration and code for parameterized prefix and rewritePrefix combinations
  • Use static analysis to flag decoded user-controlled values concatenated into URL paths without context-appropriate encoding
  • Add tests that verify path constraints remain intact when route parameters contain reserved URL characters
  • Apply policy checks that require explicit upstream destination and path allowlists
  • Review proxy and upstream logs for requests reaching paths outside the expected prefix

Sources

SourceLink
cna.openjsf.orgcna.openjsf.org/security-advisories.html
github.comgithub.com/fastify/fastify-http-proxy/security/advisories/GHSA-h3vp-4jfr-v364

Frequently asked

questions

Yes. A publicly reachable affected proxy route may be exploitable by an unauthenticated remote attacker.

No authentication is inherently required, but the attacker must be able to send requests to a route using the affected parameterized proxy configuration.

Prevent user-controlled parameters from changing upstream path boundaries. Use context-appropriate encoding, strict validation, and allowlisted upstream paths; the vulnerability description states there is no workaround other than upgrading to a fixed release.

Treat URL decoding and path rewriting as security-sensitive operations. Test boundary cases, review how each URL component is encoded, and enforce authorization at the upstream service rather than relying solely on proxy path restrictions.

Find out what's already
exploitable in your codebase.