# CVE-2026-33807: @fastify/express vulnerable to middleware path doubling causing authentication bypass in child plugin scopes

> Attackers can bypass authentication and authorization controls in child plugin scopes due to a path handling bug in the Fastify Express adapter.

- **Severity:** Critical 9.1 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 15 Apr 2026
- **Updated:** 15 Apr 2026
- **Also known as:** GHSA-hrwm-hgmj-7p9c

## What is CVE-2026-33807?

CVE-2026-33807 is a critical authentication bypass vulnerability in @fastify/express, published on 15 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

@fastify/express v4.0.4 and earlier contains a path handling bug in the onRegister function that causes middleware paths to be doubled when inherited by child plugins. When a child plugin is registered with a prefix that matches a middleware path, the middleware path is prefixed a second time, causing it to never match incoming requests. This results in complete bypass of Express middleware security controls, including authentication, authorization, and rate limiting, for all routes defined within affected child plugin scopes. No special configuration or request crafting is required.

Upgrade to @fastify/express v4.0.5 or later.

Weakness: CWE-436 (Interpretation Conflict)

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

2 open source packages ship an affected version, including @fastify/express. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@fastify/express` | npm | All versions | 4.0.5 |
| `@fastify/express` | npm | All versions | 4.0.5 |

Products: Fastify Fastify\/Express.

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

Upgrade @fastify/express to 4.0.5 or later.

## Is CVE-2026-33807 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-33807 exists.

## Other vulnerabilities in @fastify/express

- [CVE-2026-6556](https://insights.sbomify.com/CVE-2026-6556/): @fastify/express vulnerable to middleware bypass via non-string mount paths in prefixed plugins (critical 9.1)
- [CVE-2026-33808](https://insights.sbomify.com/CVE-2026-33808/): @fastify/express has a middleware authentication bypass via URL normalization gaps (duplicate slashes and semicolons) (critical 9.1)

## Fix prompt for AI coding agents

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

What it is: CVE-2026-33807 is a critical authentication bypass vulnerability in @fastify/express, published on 15 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-33807 exists.

Affected packages and fixed versions:
- @fastify/express (npm): affected all versions; fixed in 4.0.5
- @fastify/express (npm): affected all versions; fixed in 4.0.5

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-33807/ (Markdown: https://insights.sbomify.com/CVE-2026-33807/index.md)
```

## Sources

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

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