CVE-2024-22207 Default swagger-ui configuration exposes all files in the module

Medium 5.3 Published Updated

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.

PackageAffectedFixed in
@fastify/swagger-ui npmFrom 2.0.02.1.0
@fastify/swagger-ui npmFrom 2.0.02.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.

Sources

Also known as GHSA-62jr-84gf-wmg4.

Is CVE-2024-22207 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free