/

CVE-2026-85124

Severity:

HIGH RISK

(7.5)

Path Traversal (CWE-22) in Fastify HTTP Proxy Plugin

CVE-2026-85124

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized access to internal upstream endpoints and disclosure of sensitive responses

Severity:

HIGH RISK

(7.5)

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

A path traversal vulnerability in @fastify/http-proxy allows specially crafted backslash-based dot-segments to bypass the path boundary defined by proxy prefix and rewritePrefix settings. An unauthenticated network attacker may use this behavior to access upstream endpoints that were intended to remain hidden behind the proxy.

Affected context

The issue can occur in deployments using @fastify/http-proxy for plain HTTP forwarding when proxied request paths are validated incompletely. The vulnerable handling is relevant when the proxy relies on prefix or rewritePrefix boundaries and the upstream forwarding library rejects forward-slash traversal but does not equivalently reject backslash-based dot-segments.

Exploit preconditions

  • Attack surface: Network-accessible HTTP proxy endpoint
  • Required access: No authentication may be required when the proxy route is publicly reachable
  • Trigger point: Processing and forwarding of a request containing backslash-based dot-segments
  • Why exploitation is possible: Plain HTTP path validation does not consistently normalize or reject traversal variants before the request reaches the upstream

Why this happens

The vulnerability results from incomplete canonicalization and validation of proxied request paths. The plain HTTP request handler permits backslash-based dot-segments, while downstream validation recognizes only forward-slash traversal, allowing the effective path to escape the boundary established by proxy routing and rewriting rules. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, because attacker-controlled path syntax can address resources outside the intended path scope.

Potential impact

  • Unauthorized access to internal upstream routes
  • Disclosure of administrative or diagnostic endpoint responses
  • Exposure of sensitive application or service data
  • Circumvention of proxy routing and access-control assumptions
  • Increased risk of follow-on attacks against reachable upstream functionality

General mitigation guidance

Mitigation generally focuses on enforcing consistent path canonicalization and boundary validation before forwarding requests.

Common defensive patterns include:

  • Normalize equivalent path separators and dot-segments before authorization and proxy rewriting
  • Reject ambiguous traversal forms rather than relying on downstream components to interpret them
  • Apply the same validation policy across plain HTTP and WebSocket request paths
  • Define explicit allowlists for externally reachable upstream routes
  • Avoid exposing administrative or internal endpoints through broadly accessible proxy routes
  • Run upstream services with least privilege and limit sensitive endpoint access independently of the proxy
  • Use maintained releases containing the relevant validation correction

How teams detect issues like this

Organizations can look for this weakness through:

  • Static analysis and dependency review rules covering proxy path normalization and traversal checks
  • Code review signals such as validation that handles forward slashes but not alternate separators
  • Tests covering encoded, mixed-separator, and dot-segment path variants at every proxy boundary
  • Integration tests verifying that prefix and rewritePrefix settings cannot reach unintended upstream paths
  • Web application firewall or gateway policies that reject ambiguous traversal patterns
  • Monitoring for unusual requests containing repeated dot-segments, alternate separators, or unexpected upstream route access

Sources

SourceLink
cna.openjsf.orgcna.openjsf.org/security-advisories.html
github.comgithub.com/fastify/fastify-http-proxy/security/advisories/GHSA-qv33-689p-2xq5

Frequently asked

questions

Yes. If the affected proxy route is reachable over a network, an unauthenticated attacker may submit a crafted HTTP request to attempt traversal beyond the configured proxy path boundary.

No direct access to the upstream is necessarily required. The proxy may provide the attacker with a path to otherwise hidden upstream endpoints, although exposure depends on routing and deployment controls.

Use a maintained release with corrected path validation, and ensure that request paths are canonicalized and checked against an explicit permitted boundary before forwarding.

Test all path-separator and dot-segment variants, apply consistent validation across protocol handlers, use route allowlists, and enforce independent authorization at sensitive upstream endpoints.

Find out what's already
exploitable in your codebase.