/

CVE-2026-107318

Severity:

HIGH RISK

(7.4)

TLS Validation Bypass (CWE-295) in Fastify reply-from

CVE-2026-107318

Deferred

Vulnerability type

Category:

Improper Certificate Validation

CWE:

CWE-295

Impact:

Man-in-the-Middle Attack, Credential Disclosure, and Response Forgery

Severity:

HIGH RISK

(7.4)

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

@fastify/reply-from disables upstream TLS certificate verification in its built-in HTTPS transports by setting rejectUnauthorized to false by default. An on-path attacker may impersonate the configured HTTPS upstream, capture forwarded credentials and request data, and send forged responses that the application accepts.

@fastify/reply-from disables upstream TLS certificate verification in its built-in HTTPS transports by setting rejectUnauthorized to false by default. An on-path attacker may impersonate the configured HTTPS upstream, capture forwarded credentials and request data, and send forged responses that the application accepts.

Affected context

The issue affects applications using @fastify/reply-from to proxy requests to HTTPS upstream services when they rely on the plugin's built-in HTTPS transport defaults. The risk exists when network traffic between the proxy and upstream can be observed or modified and the application does not provide an explicitly configured certificate-verifying transport.

The issue affects applications using @fastify/reply-from to proxy requests to HTTPS upstream services when they rely on the plugin's built-in HTTPS transport defaults. The risk exists when network traffic between the proxy and upstream can be observed or modified and the application does not provide an explicitly configured certificate-verifying transport.

Exploit preconditions

  • Attack surface: The network connection between the Fastify proxy and its configured HTTPS upstream
  • Required access: On-path ability to intercept, modify, or redirect traffic between those systems
  • Trigger point: Establishment of an HTTPS connection by the reply-from transport
  • Why exploitation is possible: The transport disables certificate verification, allowing an impersonating upstream to be accepted without trusted identity validation
  • Attack surface: The network connection between the Fastify proxy and its configured HTTPS upstream
  • Required access: On-path ability to intercept, modify, or redirect traffic between those systems
  • Trigger point: Establishment of an HTTPS connection by the reply-from transport
  • Why exploitation is possible: The transport disables certificate verification, allowing an impersonating upstream to be accepted without trusted identity validation

Why this happens

The underlying bug is an insecure transport configuration that overrides the secure TLS default by setting rejectUnauthorized to false. This prevents the client from validating whether the upstream certificate is trusted and matches the intended server. The behavior maps to CWE-295: Improper Certificate Validation, because the application relies on encrypted transport without verifying the peer's identity.

The underlying bug is an insecure transport configuration that overrides the secure TLS default by setting rejectUnauthorized to false. This prevents the client from validating whether the upstream certificate is trusted and matches the intended server. The behavior maps to CWE-295: Improper Certificate Validation, because the application relies on encrypted transport without verifying the peer's identity.

Potential impact

  • An attacker may read credentials, authorization data, and request bodies forwarded to the upstream
  • An attacker could modify requests or inject malicious content into proxied traffic
  • The application may accept forged upstream responses
  • Session data or sensitive business information could be exposed
  • Downstream actions may be triggered using attacker-controlled responses
  • An attacker may read credentials, authorization data, and request bodies forwarded to the upstream
  • An attacker could modify requests or inject malicious content into proxied traffic
  • The application may accept forged upstream responses
  • Session data or sensitive business information could be exposed
  • Downstream actions may be triggered using attacker-controlled responses

General mitigation guidance

Mitigation should preserve certificate and hostname verification for every HTTPS upstream connection.

Common defensive patterns include:

  • Using a transport configuration that explicitly enables certificate verification
  • Supplying a preconfigured HTTP client or agent with secure TLS defaults
  • Avoiding global settings that disable certificate validation
  • Restricting trust stores to the certificates and authorities required by the deployment
  • Applying least privilege to proxy credentials and upstream access
  • Treating upstream responses as untrusted until application-level validation is complete

These measures reduce reliance on network location as a trust signal and help limit the impact of an intercepted connection.

Mitigation should preserve certificate and hostname verification for every HTTPS upstream connection.

Common defensive patterns include:

  • Using a transport configuration that explicitly enables certificate verification
  • Supplying a preconfigured HTTP client or agent with secure TLS defaults
  • Avoiding global settings that disable certificate validation
  • Restricting trust stores to the certificates and authorities required by the deployment
  • Applying least privilege to proxy credentials and upstream access
  • Treating upstream responses as untrusted until application-level validation is complete

These measures reduce reliance on network location as a trust signal and help limit the impact of an intercepted connection.

How teams detect issues like this

Organizations can identify this weakness through:

  • Static analysis searches for rejectUnauthorized: false in HTTPS client and transport configuration
  • Code review checks for disabled certificate or hostname validation
  • Dependency and configuration audits covering proxy plugins and HTTP agents
  • Runtime policy checks that reject outbound TLS connections without peer verification
  • Network monitoring for unexpected upstream certificates, destinations, or TLS handshakes

Automated security review tools may help flag insecure TLS options and transport defaults during development.

Organizations can identify this weakness through:

  • Static analysis searches for rejectUnauthorized: false in HTTPS client and transport configuration
  • Code review checks for disabled certificate or hostname validation
  • Dependency and configuration audits covering proxy plugins and HTTP agents
  • Runtime policy checks that reject outbound TLS connections without peer verification
  • Network monitoring for unexpected upstream certificates, destinations, or TLS handshakes

Automated security review tools may help flag insecure TLS options and transport defaults during development.

Sources

SourceLink
cna.openjsf.orgcna.openjsf.org/security-advisories.html
github.comgithub.com/fastify/fastify-reply-from/security/advisories/GHSA-j425-jw94-m29r

Frequently asked

questions

It can be exploited by an attacker who can operate on or influence the network path between the proxy and its HTTPS upstream. It does not generally require direct access to the proxy host.

The attacker needs on-path network capability, such as the ability to intercept, redirect, or modify traffic. The attacker may not need authenticated access to the application itself.

Ensure that the HTTPS transport performs certificate and hostname validation, either through an explicitly secure transport configuration or a trusted preconfigured HTTP client.

Enforce secure TLS defaults through code review, static analysis, dependency policy, and runtime controls that prevent disabling peer verification in production.

It can be exploited by an attacker who can operate on or influence the network path between the proxy and its HTTPS upstream. It does not generally require direct access to the proxy host.

The attacker needs on-path network capability, such as the ability to intercept, redirect, or modify traffic. The attacker may not need authenticated access to the application itself.

Ensure that the HTTPS transport performs certificate and hostname validation, either through an explicitly secure transport configuration or a trusted preconfigured HTTP client.

Enforce secure TLS defaults through code review, static analysis, dependency policy, and runtime controls that prevent disabling peer verification in production.

Find out what's already
exploitable in your codebase.