Default swagger-ui configuration exposes all files in the moduleGHSA-62jr-84gf-wmg4
MEDIUMFix: fastify/fastify-swagger-ui@13d799aGHSA-62jr-84gf-wmg4 is a medium-severity (CVSS 5.3) CWE-1188 vulnerability in @fastify/swagger-ui. A fix is available for @fastify/swagger-ui — see the affected versions and patch details below.
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-62jr-84gf-wmg4.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
@fastify/swagger-uinpmDescription
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
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @fastify/swagger-ui | ≥ 2.0.0&&< 2.1.0 | 2.1.0npm install @fastify/swagger-ui@2.1.0 |
Affected Products
swagger uismartbearDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @fastify/swagger-ui, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update @fastify/swagger-ui to 2.1.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-62jr-84gf-wmg4 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How to detect GHSA-62jr-84gf-wmg4
A community-maintained Nuclei template exists for this CVE. You can scan for it directly:
nuclei -id ghsa-62jr-84gf-wmg4 -u https://target- Template
- Fastify Swagger-UI - Information Disclosure
- Severity
- medium
- Impact
- Unauthenticated attackers can access sensitive files in the Fastify Swagger-UI module directory, potentially exposing source code or configuration files.
- Remediation
- Update @fastify/swagger-ui to version 2.1.0 or later, or configure the baseDir option.
Template by ProjectDiscovery nuclei-templates (DhiyaneshDK, iamnoooob), MIT licensed. View the full template. Scan only systems you are authorised to test.
Frequently Asked Questions
Is GHSA-62jr-84gf-wmg4 in your dependencies?
Find it across npm, including transitive dependencies.