Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-107318 Overview
CVE-2026-107318 affects @fastify/reply-from, a Fastify plugin that forwards HTTP and HTTPS requests to upstream servers. Versions prior to 12.7.0 ship built-in HTTPS transports that override the secure default and set rejectUnauthorized to false. The proxy skips TLS certificate verification for upstream HTTPS targets, even in the default configuration. An on-path network attacker can impersonate the upstream, intercept credentials and request bodies, and return forged responses the application trusts. The maintainers resolved the issue in @fastify/reply-from 12.7.0. This weakness is tracked under CWE-295 (Improper Certificate Validation).
Critical Impact
Attackers positioned on the network path between the proxy and its HTTPS upstream can perform man-in-the-middle attacks, exposing forwarded credentials and manipulating responses returned to the application.
Affected Products
- @fastify/reply-from versions prior to 12.7.0
- Fastify applications using the plugin's built-in HTTPS transports
- Node.js services proxying to HTTPS upstreams via fastify-reply-from
Discovery Timeline
- 2026-10-08 - CVE-2026-107318 published to NVD
- 2026-10-09 - Last updated in NVD database
Technical Details for CVE-2026-107318
Vulnerability Analysis
The @fastify/reply-from plugin forwards incoming requests to a configured upstream server over HTTP or HTTPS. The plugin instantiates HTTPS transports internally when the upstream URL uses the https:// scheme. These transports explicitly set the rejectUnauthorized TLS option to false, which disables Node.js certificate chain and hostname verification.
This configuration overrides the secure Node.js default. Applications that configure an HTTPS upstream inherit insecure TLS behavior without any opt-out warning. The proxy accepts self-signed, expired, or attacker-controlled certificates presented by any host on the network path. Credentials, authorization headers, and request bodies forwarded to the upstream become readable to an interposed attacker, and responses can be rewritten before reaching the proxied application.
Root Cause
The plugin's built-in HTTPS transport factory sets rejectUnauthorized: false on the TLS socket options passed to the HTTPS agent. This value is applied unconditionally for the default transport paths and is not surfaced in documentation as a user-tunable security control. The result is an improper certificate validation defect classified under CWE-295.
Attack Vector
Exploitation requires an attacker in a position to intercept traffic between the Fastify proxy and its configured HTTPS upstream. This includes compromised intermediate network devices, rogue Wi-Fi, hostile cloud network segments, DNS poisoning, and BGP hijacking. Once positioned, the attacker presents any TLS certificate and the proxy completes the handshake without validating issuer, chain, or hostname. The attacker then relays, logs, or alters the traffic in both directions. No authentication or user interaction is required on the proxy itself; the attack is executed against the TLS session the proxy initiates.
No verified proof-of-concept code is published for CVE-2026-107318. Refer to the GitHub Fastify Security Advisory for maintainer-authored technical detail.
Detection Methods for CVE-2026-107318
Indicators of Compromise
- Unexpected TLS certificates presented by hosts resolving to upstream service hostnames, including certificates with unknown issuers or short validity windows.
- Outbound TLS sessions from Fastify proxy hosts to IP addresses that do not match the published addresses of the configured upstream.
- Anomalous latency spikes on proxied HTTPS requests, which can indicate an interception point relaying traffic.
Detection Strategies
- Inventory Node.js projects and lockfiles for @fastify/reply-from entries below 12.7.0 using npm ls @fastify/reply-from or software composition analysis tooling.
- Perform static review of plugin configuration to confirm whether rejectUnauthorized: true or a hardened undici instance is explicitly supplied.
- Compare captured upstream TLS certificate fingerprints against a known-good baseline to detect substitution.
Monitoring Recommendations
- Log outbound TLS handshake metadata, including SNI, peer certificate subject, issuer, and SHA-256 fingerprint, from proxy hosts.
- Alert on certificate changes for upstream endpoints that fall outside planned rotation windows.
- Monitor egress destinations from proxy workloads and alert on new IP ranges or ASNs for established upstreams.
How to Mitigate CVE-2026-107318
Immediate Actions Required
- Upgrade @fastify/reply-from to version 12.7.0 or later in all affected services and redeploy.
- Audit every replyFrom and fastify.register invocation that targets an https:// upstream to confirm certificate validation is enforced.
- Rotate any credentials, API keys, or session tokens that may have been forwarded through a vulnerable proxy over an untrusted network path.
Patch Information
The maintainers fixed the defect in @fastify/reply-from 12.7.0 by removing the insecure rejectUnauthorized: false default from built-in HTTPS transports. Users should upgrade to 12.7.0 or later. See the GitHub Fastify Security Advisory GHSA-j425-jw94-m29r and the OpenJSF Security Advisories for release details.
Workarounds
- Pass an explicit rejectUnauthorized: true on the HTTPS transport options when registering the plugin.
- Supply an already configured undici instance that enforces certificate validation to the plugin.
- Configure and use the undici global agent with strict TLS verification across the Node.js process.
# Upgrade the vulnerable plugin
npm install @fastify/reply-from@^12.7.0
# Verify installed version
npm ls @fastify/reply-from
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

