/

CVE-2026-117518

Severity:

HIGH RISK

(8.2)

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

CVE-2026-117518

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized access to unintended upstream resources

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

In affected @fastify/reply-from versions, backslash-based dot segments can bypass path validation and be normalized by the URL parser into a different upstream path. When an application relies on the proxy to restrict access to an upstream prefix, an unauthenticated request may reach unintended upstream endpoints, primarily risking confidentiality.

In affected @fastify/reply-from versions, backslash-based dot segments can bypass path validation and be normalized by the URL parser into a different upstream path. When an application relies on the proxy to restrict access to an upstream prefix, an unauthenticated request may reach unintended upstream endpoints, primarily risking confidentiality.

Affected context

The issue occurs in applications using @fastify/reply-from to forward requests to an upstream HTTP server when proxy paths are intended to be limited to a specific prefix. It becomes risky when path validation checks forward-slash dot segments but URL construction later normalizes backslashes or their percent-encoded form for supported schemes. Applications that rely on route guards before forwarding may also be affected if those guards do not account for the normalized destination.

The issue occurs in applications using @fastify/reply-from to forward requests to an upstream HTTP server when proxy paths are intended to be limited to a specific prefix. It becomes risky when path validation checks forward-slash dot segments but URL construction later normalizes backslashes or their percent-encoded form for supported schemes. Applications that rely on route guards before forwarding may also be affected if those guards do not account for the normalized destination.

Exploit preconditions

  • Attack surface: An application endpoint that forwards requests through @fastify/reply-from
  • Required access: The described scenario can involve unauthenticated requests; the proxy endpoint must be reachable
  • Trigger point: Request path validation and subsequent construction of the upstream URL
  • Why exploitation is possible: Backslash-based dot segments can evade validation and then be normalized into path traversal by the URL parser, potentially escaping the intended upstream prefix
  • Attack surface: An application endpoint that forwards requests through @fastify/reply-from
  • Required access: The described scenario can involve unauthenticated requests; the proxy endpoint must be reachable
  • Trigger point: Request path validation and subsequent construction of the upstream URL
  • Why exploitation is possible: Backslash-based dot segments can evade validation and then be normalized into path traversal by the URL parser, potentially escaping the intended upstream prefix

Why this happens

The path validation and URL construction stages interpret path separators differently. Validation checks forward-slash dot segments, while the WHATWG URL parser normalizes backslashes and encoded backslashes for relevant schemes. This mismatch allows a path to pass the check but resolve to a different upstream location, mapping to CWE-22: Improper Limitation of a Pathname to a Restricted Directory.

The path validation and URL construction stages interpret path separators differently. Validation checks forward-slash dot segments, while the WHATWG URL parser normalizes backslashes and encoded backslashes for relevant schemes. This mismatch allows a path to pass the check but resolve to a different upstream location, mapping to CWE-22: Improper Limitation of a Pathname to a Restricted Directory.

Potential impact

  • Requests may reach upstream endpoints outside the intended prefix.
  • Sensitive upstream resources may be disclosed.
  • Limited integrity impact may occur if unintended endpoints allow state-changing operations.
  • Requests may reach upstream endpoints outside the intended prefix.
  • Sensitive upstream resources may be disclosed.
  • Limited integrity impact may occur if unintended endpoints allow state-changing operations.

General mitigation guidance

Prefer a vendor-fixed release and ensure paths are canonicalized and validated before constructing the destination URL. Reject dot segments, control characters, and ambiguous whitespace after normalization, and use allowlisted upstream paths or destinations where practical. Avoid relying solely on route guards that may evaluate a different path representation, and limit the proxy's upstream permissions to the resources it needs.

Prefer a vendor-fixed release and ensure paths are canonicalized and validated before constructing the destination URL. Reject dot segments, control characters, and ambiguous whitespace after normalization, and use allowlisted upstream paths or destinations where practical. Avoid relying solely on route guards that may evaluate a different path representation, and limit the proxy's upstream permissions to the resources it needs.

How teams detect issues like this

Review proxy path validation and URL construction for differences in separator and encoding normalization. Static analysis and code review can look for validation performed before canonicalization, especially when paths are subsequently passed to URL parsers. Test that policy enforcement applies to the final normalized destination, and consider CI checks that reject ambiguous path forms in proxy-routing code.

Review proxy path validation and URL construction for differences in separator and encoding normalization. Static analysis and code review can look for validation performed before canonicalization, especially when paths are subsequently passed to URL parsers. Test that policy enforcement applies to the final normalized destination, and consider CI checks that reject ambiguous path forms in proxy-routing code.

Sources

SourceLink
cna.openjsf.orgcna.openjsf.org/security-advisories.html
github.comgithub.com/fastify/fastify-reply-from/security/advisories/GHSA-vp2r-3vgv-32g9

Frequently asked

questions

It may be exploitable through a reachable forwarding endpoint. The described scenario allows unauthenticated requests when the application exposes that endpoint without requiring authentication.

The attacker needs to reach an application route that forwards requests through the affected proxy behavior; access to the upstream server itself is not necessarily required.

Use a vendor-fixed release and normalize paths before validating them. Reject traversal segments and ensure the validated path is the same representation used to construct the upstream URL.

Apply access controls to the final destination, use allowlists for upstream paths, and test path-handling policies against alternate separators and encoded forms.

It may be exploitable through a reachable forwarding endpoint. The described scenario allows unauthenticated requests when the application exposes that endpoint without requiring authentication.

The attacker needs to reach an application route that forwards requests through the affected proxy behavior; access to the upstream server itself is not necessarily required.

Use a vendor-fixed release and normalize paths before validating them. Reject traversal segments and ensure the validated path is the same representation used to construct the upstream URL.

Apply access controls to the final destination, use allowlists for upstream paths, and test path-handling policies against alternate separators and encoded forms.

Find out what's already
exploitable in your codebase.