CVE-2026-130886: @fastify/reply-from path traversal bypass allows upstream prefix escape

@fastify/reply-from 12.8.1 through 12.8.3 contains a path traversal bypass in buildURL. An attacker can craft a source beginning with the same scheme as the base (http/https) plus percent-encoded parent-directory segments; the WHATWG URL parser treats it as a relative path, bypassing the per-segment check. Upstream servers that percent-decode before resolving dot-segments can serve paths outside the configured prefix. Fixed in 12.8.4.

Details

CVE-2026-130886 affects @fastify/reply-from versions 12.8.1 through 12.8.3. The plugin's buildURL function checks attacker-supplied source strings for parent-directory segments, but when the source begins with the same special scheme as the base (e.g. http or https), the WHATWG URL parser drops the scheme and resolves the remainder as a relative path. A payload that glues the scheme to a percent-encoded parent-directory sequence passes the check because the inspected segment reads as the scheme plus dots rather than a bare parent-directory token, while the proxy forwards the encoded traversal unchanged.

If the upstream server percent-decodes the request path before resolving dot-segments, an unauthenticated client scoped to an upstream prefix (or relying on Fastify route guards in front of the proxy) can escape that prefix and reach sibling or parent upstream endpoints. The per-segment check added in 12.8.1 is bypassed by the scheme prefix; releases up to 12.8.0 already rejected the decoded form.

What to do

1. Upgrade @fastify/reply-from to 12.8.4 or later in all Node.js services using the plugin. 2. Review the vendor advisory and NVD entry for any additional mitigations: https://github.com/fastify/fastify-reply-from/security/advisories/GHSA-2ccw-8rvh-6cmg and https://nvd.nist.gov/vuln/detail/CVE-2026-130886. 3. If an immediate upgrade is not possible, verify the vendor advisory before applying interim mitigations to production. 4. After upgrading, audit proxy logs for requests to sibling or parent upstream paths that may indicate attempted exploitation.

References

- https://nvd.nist.gov/vuln/detail/CVE-2026-130886 - https://cna.openjsf.org/security-advisories.html - https://github.com/fastify/fastify-reply-from/security/advisories/GHSA-2ccw-8rvh-6cmg

Sources