CVE-2026-81525
largeUntrusted namespace injection in MongoDB PHP library targets other collections/databases
The mongodb/mongodb PHP library, the official MongoDB abstraction layer for PHP distributed via Composer, failed to reject '.' (dot) and NUL bytes in database and collection names. If an application passes untrusted user input as part of a database or collection name, an attacker can craft a name containing these characters so that operations target a different database or collection than the one the application specified. Under the published CVSS 4.0 vector, an attacker with low privileges (i.e., valid MongoDB credentials) over the network could read or modify data in unintended namespaces. Any PHP application using the library before version 1.21.4 (1.x branch) or 2.4.1 (2.x branch) is affected, though only deployments that interpolate untrusted input into database or collection names are practically exploitable. There is no known public proof of concept, no in-the-wild exploitation, and EPSS estimates only about a 0.3% probability of exploitation within 30 days.
What to do: Upgrade the mongodb/mongodb Composer package to 1.21.4 or later on the 1.x branch, or 2.4.1 or later on the 2.x branch. As a workaround, validate and sanitize database and collection names before passing them into library APIs, rejecting '.' and NUL bytes. Audit code paths where user-supplied input is used in database or collection names to determine whether your deployment is practically exposed.
| mongodb/mongodb PHP library (Composer package) | 1.x before 1.21.4 and 2.x before 2.4.1 |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
The MongoDB client library for PHP does not sufficiently sanitize special elements in application-supplied namespace identifiers before using them to construct the target namespace for database operations. An application that incorporates untrusted text into these identifiers may have operations silently directed at a different storage location than the one the application intended.
- Ecosystems
- composer
- Weakness
- CWE-943
- Vector
- CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
- GHSA
- GHSA-65fr-j4p9-vc33 (high)
In the news0 stories
No ingested article mentions this CVE yet.