Vulnerability · Published Jan 15, 2024 · Assigned by GitHub_M
CVE-2024-22207Default swagger-ui configuration exposes all files in the module
Medium 5.3
In plain English
A medium-severity security flaw in fastify-swagger-ui from fastify. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 2.3% (higher than 83% of all known vulnerabilities). Ready-made attack tooling exists: Nuclei. Fixed versions are available - upgrade the affected package.
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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| npm | @fastify/swagger-ui | 2.1.0 | GHSA-62jr-84gf-wmg4 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| fastify | fastify-swagger-ui | < 2.1.0 |
Weakness: CWE-1188 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N