/

CVE-2026-130886

Severity:

HIGH RISK

(8.2)

Path Traversal (CWE-22) in @fastify/reply-from Plugin

CVE-2026-130886

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Upstream path-prefix and route-guard bypass

Severity:

HIGH RISK

(8.2)

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 flaw in @fastify/reply-from can let a client send requests outside the upstream path prefix configured for the proxy. It becomes risky when the upstream server decodes percent-encoded paths before resolving dot segments, potentially allowing access to sibling or parent endpoints.

Affected context

The issue affects @fastify/reply-from versions 12.8.1 through 12.8.3, where buildURL checks attacker-controlled source paths for parent-directory segments. A scheme prefix can evade that per-segment check while the encoded traversal remains in the forwarded path. Exposure depends on the upstream server's path-decoding and dot-segment handling.

Exploit preconditions

  • Attack surface: An HTTP route that proxies client-controlled request paths through @fastify/reply-from
  • Required access: An unauthenticated client may be sufficient if the proxy endpoint is publicly reachable
  • Trigger point: URL construction and forwarding of the client-supplied source path
  • Upstream condition: The upstream server percent-decodes the path before resolving dot segments
  • Why exploitation is possible: A scheme-prefixed path can bypass the segment check, while the encoded traversal is forwarded for the upstream to interpret

Why this happens

The URL-building logic checks path segments for traversal, but URL parsing can treat a source beginning with the same special scheme as the base URL as a relative path and remove the scheme. This means the checked segment may not appear to be a bare parent-directory token, even though the encoded traversal remains in the forwarded path.

This is a path traversal weakness mapped to CWE-22: Improper Limitation of a Pathname to a Restricted Directory. The underlying insecure pattern is validating a parsed representation that differs from the representation later interpreted by the upstream server.

Potential impact

  • A client may reach sibling or parent upstream endpoints outside the configured prefix
  • Fastify route guards or proxy-level path scoping could be bypassed
  • Protected upstream data or functionality could be exposed
  • Requests could reach endpoints with unintended side effects

General mitigation guidance

Defensive patterns focus on validating the exact path representation that will be forwarded and interpreted downstream.

  • Use a canonicalization strategy consistent with the upstream server's decoding and path-resolution behavior
  • Reject traversal after decoding, and avoid forwarding ambiguous or multiply encoded paths
  • Prefer allowlisting permitted upstream paths over relying only on denylisting traversal tokens
  • Keep proxy routing and upstream authorization checks independent of client-controlled path prefixes
  • Apply least privilege to upstream credentials and restrict access to sensitive endpoints

How teams detect issues like this

  • Review URL construction and validation code for differences between parsed, decoded, and forwarded path representations
  • Use static analysis or code review checks to flag traversal checks that run before canonicalization
  • Test proxy behavior against upstreams that decode percent-encoded paths before resolving dot segments
  • Enforce policies that require upstream authorization and prevent proxy routes from granting broader access than intended

Sources

SourceLink
cna.openjsf.orgcna.openjsf.org/security-advisories.html
github.comgithub.com/fastify/fastify-reply-from/security/advisories/GHSA-2ccw-8rvh-6cmg

Frequently asked

questions

It may be exploitable by a remote client when a reachable proxy route accepts client-controlled paths and the upstream handles encoded traversal as described.

The described scenario may require no authentication if the proxy endpoint is publicly accessible. Otherwise, access depends on the deployment's route and network controls.

Validate a canonical path representation that matches what the upstream will interpret, reject traversal, and enforce authorization at the upstream as well as the proxy.

Treat URL parsing and decoding as security boundaries: test their behavior across proxy and upstream components, prefer allowlisted routing, and avoid relying on checks against a representation that will later change.

Find out what's already
exploitable in your codebase.