MongoDB Node.js Driver 7.9.1 Patches Credential Leak in Connection String Errors

2 min read
Source: MongoDB | Alerts
TL;DR

MongoDB has released version 7.9.1 of its Node.js driver to fix a security flaw where invalid connection strings could expose username and password credentials in error logs. The bug, present in version 7.9.0, occurred when a connection string lacked a host separator, causing the driver to dump sensitive data into the 'host' field before logging the parse error. The update redacts these values to prevent accidental exposure in application logs.

Key points

  • The vulnerability affected MongoDB Node.js driver version 7.9.0, released in November 2026.
  • Invalid connection strings missing a host separator caused credentials to be incorrectly parsed into the 'host' field.
  • This resulted in sensitive data being included in error messages and subsequently logged by applications.
  • The fix, included in version 7.9.1, strips and redacts the original input from the TypeError message.
  • The issue was classified as a Major priority bug and resolved on November 19, 2026.

Background

This update follows the release of version 7.9.0 on November 12, 2026, which addressed OIDC token leaks and improved error handling. The current patch specifically targets a regression or oversight in how connection string parsing errors are handled, ensuring that sensitive URI components are not exposed during validation failures.

Why it matters

Leaking credentials in logs is a critical security risk, as these logs are often accessible to developers, monitoring systems, or attackers who gain access to server infrastructure. This fix prevents a common misconfiguration from leading to a data breach, aligning with broader industry efforts to secure sensitive data in error reporting.

What to watch

Developers using the MongoDB Node.js driver should upgrade to version 7.9.1 immediately. The fix is part of a broader effort to enforce strict rules on what URI components are considered sensitive during parsing, as outlined in related driver specifications.

Share this article

Want the full story? Read the original reporting

Read on MongoDB | Alerts