Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
The probability is the direct output of the EPSS model, and conveys an overall sense of the threat of exploitation in the wild. The percentile measures the EPSS probability relative to all known EPSS scores. Note: This data is updated daily, relying on the latest available EPSS model version. Check out the EPSS documentation for more details.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsLearn about Information Exposure vulnerabilities in an interactive lesson.
Start learningUpgrade mongodb to version 7.9.1 or higher.
mongodb is an official MongoDB driver for Node.js.
Affected versions of this package are vulnerable to Information Exposure in the HostAddress class in utils.ts and the parseOptions function in connection_string.ts, which include connection-string components in the messages and cause of errors thrown during MongoClient construction and connection. An attacker with access to the application's logs can obtain database credentials when the application passes a connection string with credentials but no valid host, because the user:pass portion is parsed as host:port and appears in the resulting Unable to parse ... with URL error and its cause.input. This affects only applications that build connection strings from user or configuration input where a missing or malformed host can reach the driver, and that log driver errors or MongoClient instances.
This vulnerability can be avoided by validating that connection strings contain a host before passing them to the driver, and by redacting the message and cause of errors raised during MongoClient construction or connection before logging them.