Improper Neutralization of Null Byte or NUL Character Affecting mongodb package, versions >=1.3.11 <7.9.1


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.29% (14th percentile)

Do your applications use this vulnerable package?

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 applications
  • Snyk IDSNYK-JS-MONGODB-22958511
  • published25 Nov 2026
  • disclosed19 Nov 2026
  • creditUnknown

Introduced: 19 Nov 2026

NewCVE-2026-129929  (opens in a new tab)
CWE-158  (opens in a new tab)

How to fix?

Upgrade mongodb to version 7.9.1 or higher.

Overview

mongodb is an official MongoDB driver for Node.js.

Affected versions of this package are vulnerable to Improper Neutralization of Null Byte or NUL Character in the plain.js PLAIN authentication provider, which builds the SASL PLAIN message by joining the username and password with NUL separators without rejecting NUL characters inside either field. A user with valid credentials for one identity can authenticate as that identity instead of the one the application constructed, bypassing application-side identity checks such as an allow list or a required username suffix, by supplying a username containing NUL-separated authentication and password values. This affects only applications that use authMechanism: 'PLAIN' and build the username or password from less trusted input.

Workaround

This vulnerability can be avoided by rejecting any username or password that contains a NUL character (\0, or %00 in a connection string) before passing it to MongoClient.

CVSS Base Scores

version 4.0
version 3.1