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

Published Jan 15, 2024
·
Updated

Impact

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.

Patches

Update to v2.1.0

Workarounds

Use the baseDir option

References

HackerOne report .

Other sources

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.

NVD

Affected Software

2 affected componentsFixes available
npm/@fastify/swagger-ui>=2.0.0<2.1.0
2.1.0
SMARTBEAR Swagger Ui Node.js>=2.0.0<2.1.0

Event History

Jan 15, 2024
CVE Published
via MITRE·03:40 PM
Data Sourced
via MITRE·03:40 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·04:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Jan 16, 2024
Advisory Published
via GitHub·03:24 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-22207?

CVE-2024-22207 is considered a high-severity vulnerability due to the risk of unauthorized file exposure.

2

How do I fix CVE-2024-22207?

To fix CVE-2024-22207, update to version 2.1.0 of the @fastify/swagger-ui package.

3

What is the impact of CVE-2024-22207?

The default configuration of @fastify/swagger-ui allows all files in its directory to be exposed via HTTP routes, leading to potential data leakage.

4

How can I mitigate CVE-2024-22207 without updating?

You can mitigate CVE-2024-22207 by setting the `baseDir` option in the configuration of @fastify/swagger-ui.

5

Which versions are affected by CVE-2024-22207?

Versions of @fastify/swagger-ui between 2.0.0 and 2.1.0 are affected by CVE-2024-22207.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203