CVE-2026-18174: Fastify @fastify/forwarded improper input validation in X-Forwarded-For header

CVE-2026-18174 · Severity: medium · CVSS 5.3 · Published 2026-07-29

@fastify/forwarded is a utility library used by the Fastify web framework to identify the original IP address of a user connecting through a proxy. A flaw in how the library handles web headers allows attackers to bypass security controls like IP-based blocklists or rate limits by inserting a hidden tab character. While this does not allow an attacker to impersonate a trusted internal server, it can be used to evade restrictions intended to block malicious traffic or prevent automated abuse.

Vendors: Fastify.

Quick answers

Is CVE-2026-18174 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-18174 being exploited in the wild.
How severe is CVE-2026-18174?
Medium severity, with a CVSS score of 5.3, published 29 July 2026.
Which products and versions are affected?
Fastify Forwarded < 3.0.2.
Is there a fix for CVE-2026-18174?
A patch was published on 2026-07-29: Fix released in version 3.0.2 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-18174 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-18174?
Check whether you run Fastify Forwarded at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

The vulnerability is an improper input validation issue (CWE-20) within the X-Forwarded-For header parser. While RFC 7230 defines optional whitespace as both spaces and horizontal tabs, @fastify/forwarded versions prior to 3.0.2 only trimmed space characters. An attacker can inject a horizontal tab (\t) before their IP address in the header, causing the library to resolve a string containing the literal tab (e.g., '\t1.2.3.4'). Because security mechanisms like rate limiters or IP allowlists typically perform exact string matches, the corrupted string will fail to match the expected IP, effectively evading the check. This issue is resolved in version 3.0.2.

Affected products

  • Fastify @fastify/forwarded < 3.0.2

Timeline

  • 2026-07-28: advisory: GitHub Security Advisory published
  • 2026-07-29: disclosed: NVD publication date
  • 2026-07-29: patched: Fix released in version 3.0.2

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.