First published: Mon 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 ](https://hackerone.com/reports/2312369).
Credit: security-advisories@github.com security-advisories@github.com
Affected Software | Affected Version | How to fix |
---|---|---|
npm/@fastify/swagger-ui | >=2.0.0<2.1.0 | 2.1.0 |
SmartBear Swagger UI | >=2.0.0<2.1.0 |
Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.
CVE-2024-22207 is considered a high-severity vulnerability due to the risk of unauthorized file exposure.
To fix CVE-2024-22207, update to version 2.1.0 of the @fastify/swagger-ui package.
The default configuration of @fastify/swagger-ui allows all files in its directory to be exposed via HTTP routes, leading to potential data leakage.
You can mitigate CVE-2024-22207 by setting the `baseDir` option in the configuration of @fastify/swagger-ui.
Versions of @fastify/swagger-ui between 2.0.0 and 2.1.0 are affected by CVE-2024-22207.