Executive Summary
CVE-2026-120213 is a path traversal (CWE-22) flaw in @fastify/http-proxy, the Fastify plugin that proxies HTTP requests to an upstream server under a configured prefix. When an application pins clients to a fixed upstream path using a parameterized prefix together with rewritePrefix, the plugin substitutes URL-decoded route parameters into the rewritten path without re-encoding them. An attacker can smuggle /, ? or # characters through a parameter and escape the intended upstream path.
The advisory is tracked as GHSA-h3vp-4jfr-v364 and was published on 2026-11-02. The GitHub advisory rates it critical; the CVSS base score listed by NVD-derived sources is 9.1, although some aggregators score it lower because exploitability depends heavily on the upstream service.
Vulnerability Details
| Field | Value |
|---|---|
| CVE ID | CVE-2026-120213 |
| Package | @fastify/http-proxy (npm) |
| Affected versions | 9.0.0 through 11.6.5 |
| Fixed version | 11.6.6 |
| Weakness | CWE-22 Path Traversal |
| CVSS | 9.1 (Critical) |
| Published | 2026-11-02 |
How it works
Consider a route configured as follows:
prefix: '/tenants/:tenantId/public-avatar'rewritePrefix: '/:tenantId/public-avatar'
The intent is that every request is forwarded to /<tenantId>/public-avatar. Because the decoded parameter is inserted verbatim, a request such as /tenants/admin%2fmaster-keys%23/public-avatar is forwarded upstream as GET /admin/master-keys. The decoded # (or ?) truncates the pinned suffix, so the /public-avatar restriction is dropped.
Impact
- Bypass of path restrictions the proxy is meant to enforce
- Access to upstream endpoints never intended to be reachable by clients
- Depending on the upstream, SSRF-like behavior or authorization bypass in the proxied service
Applications that use a fixed prefix with no route parameters are not affected by this specific pattern.
Related Issues
Two earlier or adjacent @fastify/http-proxy issues are tracked separately and are worth checking while you upgrade:
- CVE-2026-16117 (GHSA-mx7v-qhg9-2mvv): versions 11.5.0 and earlier failed to rewrite the prefix when percent-encoded characters were used in the prefix portion of the URL. Fixed in 11.6.0.
- CVE-2026-120214: versions 11.6.0 through 11.6.2 normalize backslashes before percent-decoding, letting encoded backslashes and dot-segments slip past destination validation.
Remediation
- Upgrade to @fastify/http-proxy 11.6.6 or later (
npm ls @fastify/http-proxyto find transitive copies). - Search your code for
prefixvalues containing:paramsegments combined withrewritePrefix. - As a stopgap, validate route parameters with a strict schema (for example an alphanumeric pattern) so that
%2f,%23and%3fare rejected before proxying. - Make sure upstream services enforce their own authorization rather than relying on the proxy's path pinning.