CVE-2024-22207 Default swagger-ui configuration exposes all files in the module
Default configuration exposes all module files via HTTP routes, allowing attackers to read sensitive source code or configuration files.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-22207?
CVE-2024-22207 is a medium-severity vulnerability in fastify-swagger-ui, published on 15 Jan 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
fastify-swagger-ui is a Fastify plugin for serving Swagger UI. Prior to 2.1.0, the default configuration of `@fastify/swagger-ui` without `baseDir` set will lead to all files in the module's directory being exposed via http routes served by the module. The vulnerability is fixed in v2.1.0. Setting the `baseDir` option can also work around this vulnerability.
Weakness: CWE-1188
Which versions are affected by CVE-2024-22207?
2 open source packages ship an affected version, including @fastify/swagger-ui. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
@fastify/swagger-ui npm | From 2.0.0 | 2.1.0 |
@fastify/swagger-ui npm | From 2.0.0 | 2.1.0 |
Products include Smartbear Swagger Ui.
How do I fix CVE-2024-22207?
Upgrade @fastify/swagger-ui to 2.1.0 or later.
Is CVE-2024-22207 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-22207 exists.
Public exploit code: 1 Nuclei template.
Other vulnerabilities in fastify-swagger-ui
Sources
Also known as GHSA-62jr-84gf-wmg4.