# CVE-2026-18174: @fastify/forwarded vulnerable to improper input validation via unstripped tab characters in X-Forwarded-For

> Attackers can bypass IP-based security controls like allowlists or rate limits by injecting tab characters into the X-Forwarded-For header.

- **Severity:** Medium 5.3 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 29 Jul 2026
- **Updated:** 29 Jul 2026
- **Also known as:** GHSA-2849-m2w7-xm8f

## What is CVE-2026-18174?

CVE-2026-18174 is a medium-severity vulnerability in @fastify/forwarded, published on 29 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

@fastify/forwarded resolves client addresses from the X-Forwarded-For header. In versions before 3.0.2, when the header contains two or more comma separated entries, the parser trims only space characters and does not strip horizontal tabs, even though RFC 7230 defines optional whitespace as both space and tab. As a result, an entry padded with a tab keeps the literal tab in the resolved address string. Applications that make exact string match security decisions on the resolved client IP, such as an allowlist, a blocklist, a per IP rate limit key, or audit log correlation, can be evaded because the tab corrupted string no longer matches the expected value. This does not cross the trust boundary, since a tab corrupted string is not a valid IP and cannot be mistaken for a trusted proxy. The issue is fixed in @fastify/forwarded 3.0.2.

Weakness: CWE-20 (Improper Input Validation), CWE-184 (Incomplete List of Disallowed Inputs)

## Which versions are affected by CVE-2026-18174?

It affects 1 product.


Products: Fastify Fastify\/Forwarded.

## How do I fix CVE-2026-18174?

No fix has been published for CVE-2026-18174 yet. Limit exposure of the affected software until one is available.

## Is CVE-2026-18174 being exploited?

There is no known exploitation of CVE-2026-18174 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-18174 and fix it if it is affected.

What it is: CVE-2026-18174 is a medium-severity vulnerability in @fastify/forwarded, published on 29 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-18174 in the wild and no public exploit code.

Affected product: @fastify/forwarded. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-18174/ (Markdown: https://insights.sbomify.com/CVE-2026-18174/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-18174
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-18174
- OSV: https://osv.dev/vulnerability/CVE-2026-18174

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-18174/
Summaries are generated and may contain mistakes; the official description above is the record.
