S4E just found a medium-severity finding from self signed ssl certificate detection
PlatformPlansPartners
Resources
ToolsBlogDocs
Sign Up →
medium·Product Based Web Vulnerabilities·Updated Oct 8, 2024

CVE-2024-22207 Scanner

CVE-2024-22207 Scanner - Information Disclosure vulnerability in Fastify Swagger-UI

Est. Time~10 seconds
Scan TypeSingle Scan
Targetsurl
CostFree
2.8k
Times Used
continuous scan runs
5.9k
Continuously Checked
assets under CS
2
Vulnerabilities Found
confirmed findings
References
CVECVE-2024-22207
5.3
CVSSmedium
Exploitable remotely over the internet · no authentication required.

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.

Attack Vector
Network
Privileges Req.
None
User Interaction
None
Affected
fastify-swagger-uiby fastify
< 2.1.0
Updated Sep 10, 2026View on NVD →
Detail

Fastify Swagger-UI is a plugin used to serve Swagger UI, a popular tool for visualizing and interacting with API specifications. It is widely used by developers to simplify API documentation and provide a user-friendly interface. This plugin is integrated into applications to create an interactive API documentation easily. Many organizations utilize it as part of their development and testing environments. Fastify, known for its speed and low overhead, makes it an attractive choice for API development, leveraging Swagger UI through this plugin for streamlined user access. The plugin supports customization to fit specific documentation needs while maintaining simplicity and ease of use.

The vulnerability involves an information disclosure issue within the swagger_ui plugin for Fastify. Specifically, when the configuration of '@fastify/swagger-ui' is left default without setting the 'baseDir', it can expose all files within the module’s directory to HTTP routes. This could allow unauthorized access to module files, potentially leading to information leakage. To combat this, the vulnerability has been addressed in version 2.1.0, providing increased safeguarding against accidental exposures. The issue highlights the importance of correct configuration to prevent unintentional data disclosures. The risk primarily concerns development environments if the `baseDir` setting is overlooked.

Technically, the vulnerability resides in the default configuration of the Fastify Swagger-UI plugin. Without a configured 'baseDir', all files within the directory of the module are exposed via HTTP routes. This configuration oversight could lead to unintentional exposure of sensitive information within environments that utilize this plugin. The vulnerable endpoint relates to HTTP routes that could serve unintended files due to this setting. The module's directory becomes openly accessible until overridden by the user-defined `baseDir`. Ensuring that the option is correctly set prevents these exposures.

Exploitation of this vulnerability can result in sensitive files being accessible to unauthorized users, leading to potential information leakage. This can compromise the integrity and confidentiality of the affected application. If sensitive files such as configuration files, credentials, or other proprietary source code reside within the exposed directory, it adds a significant risk. Attackers can glean insights into the application's structure, leading to further attacks. Proper mitigation is crucial to avoid such unauthorized information disclosures impacting both development and production environments.

REFERENCES

Solution Advice
  • Update `@fastify/swagger-ui` to version 2.1.0 or newer, where the vulnerability is patched.
  • Ensure that the `baseDir` setting is configured to restrict exposure of unnecessary files.
  • Conduct a code review to check for any other possible misconfigurations within the development environment.
  • Limit access to development environments where unsecured plugins might expose sensitive data.
  • Regularly audit plugins and dependencies for security updates and involve them in your continuous integration practices.

Get AI-powered remediation steps tailored to your asset.

Try AI Solutions →

Check your infrastructure.
Right now.

11,000+ scanners. Free to start. No credit card required.

CVE-2024-22207 Scanner - Information Disclosure vulnerability in Fastify Swagger-UI | S4E