CVE-2026-15631

@fastify/http-proxy vulnerable to prefix escape via WebSocket path traversal

Published Jul 18, 2026 CVSS 3.1 · 8.7 High EPSS < 1% KEV · Not listed
Description
Impact: @fastify/http-proxy versions from 9.4.0 up to and including 11.5.0 fail to validate the resolved WebSocket destination path against the configured rewrite prefix. The WebSocket routing path in WebSocketProxy.findUpstream resolves the destination via the WHATWG URL constructor, which collapses dot segments, so a crafted upgrade request with path traversal sequences can escape the rewrite prefix and reach upstream endpoints that were not meant to be exposed by the proxy. This is a variant of CVE-2021-21322 in a code path that never went through the HTTP fix in fastify/reply-from. Exploitation requires a non-normalizing WebSocket client, since browsers and the ws package normalize the request path before sending, but raw HTTP clients or downstream proxies that forward the request target unchanged make the attack reachable in production topologies.

Patches: upgrade to @fastify/http-proxy 11.6.0.

Workarounds: none.

Analysis

AI-generated

Technical impact

The vulnerability exists in @fastify/http‑proxy versions 9.4.0 through 11.5.0, where the WebSocket proxy does not validate the resolved destination path against the configured rewrite prefix. The path resolution uses the WHATWG URL constructor, which collapses dot segments, allowing a crafted WebSocket upgrade request containing traversal sequences to escape the intended prefix. This results in requests being forwarded to upstream endpoints that were not intended for exposure. The flaw is a variant of CVE‑2021‑21322 but operates in a code path that never applied the HTTP‑specific fix in fastify/reply‑from. As a result, an attacker can potentially direct the proxy to any reachable upstream service using a non‑normalizing WebSocket client, enabling unauthorized data access or malicious control of downstream services.

Affected Systems

Any Node.js application that incorporates @fastify/http‑proxy in versions 9.4.0 to 11.5.0 is affected. The vulnerability applies to the entire @fastify/http‑proxy package used as a Fastify plugin or standalone HTTP WebSocket proxy.

Risk and Exploitability

The CVSS score is 8.7, indicating a high severity. The EPSS score is below 1 %, suggesting low probability of exploitation in the wild, although it is not zero. The vulnerability is not listed in CISA's KEV catalog. Exploitation requires a WebSocket client or proxy that does not normalize the request path, so browsers and the standard ws package are not susceptible. However, raw HTTP clients or downstream proxies that forward the original path can enable the attack in production environments. Overall, the risk is significant for exposed WebSocket proxy deployments, but the attack window is limited by the need for a non‑normalizing client or an untrusted network path.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to @fastify/http-proxy version 11.6.0 or later, which contains the fix for the path traversal issue.
  • Review application logs to confirm that no requests are being forwarded to unexpected upstream targets.
  • Restrict WebSocket upgrade requests to trusted clients or use additional filtering to ensure that only intended paths reach the upstream services.

Generated by OpenCVE AI on July 30, 2026 at 23:11 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Fastify
Fastify fastify-http-proxy
Vendors & Products Fastify
Fastify fastify-http-proxy
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description Impact: @fastify/http-proxy versions from 9.4.0 up to and including 11.5.0 fail to validate the resolved WebSocket destination path against the configured rewrite prefix. The WebSocket routing path in WebSocketProxy.findUpstream resolves the destination via the WHATWG URL constructor, which collapses dot segments, so a crafted upgrade request with path traversal sequences can escape the rewrite prefix and reach upstream endpoints that were not meant to be exposed by the proxy. This is a variant of CVE-2021-21322 in a code path that never went through the HTTP fix in fastify/reply-from. Exploitation requires a non-normalizing WebSocket client, since browsers and the ws package normalize the request path before sending, but raw HTTP clients or downstream proxies that forward the request target unchanged make the attack reachable in production topologies. Patches: upgrade to @fastify/http-proxy 11.6.0. Workarounds: none.
Title @fastify/http-proxy vulnerable to prefix escape via WebSocket path traversal
Weaknesses CWE-22
References
Metrics cvssV3_1

{'score': 8.7, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N'}

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Sources

Status
PUBLISHED
Assigner
openjs
Published
Updated
Jul 20, 2026, 3:15 PM
Reserved
Jul 13, 2026, 5:46 PM
Status
Analyzed
Published
Jul 18, 2026, 1:17 PM
Modified
Jul 28, 2026, 3:42 PM