GHSA-65fr-j4p9-vc33high8.1
mongodb: Reject "." and NUL bytes in database and collection names
Impact
Passing untrusted input as part of a database or collection name may result in targeting a different database or collection than specified.
Source excerpt · OSVAffected packages
Start with the recorded fix for your release branch. Check your installed version and test compatibility before upgrading. Fixing this advisory does not rule out other vulnerabilities in the release.
mongodb/mongodb Packagist
| Affected range | Recorded fix |
|---|---|
| Earlier releases before 1.21.4Ecosystem versions | 1.21.4 |
| From 2.0.0 before 2.4.1Ecosystem versions | 2.4.1 |
Version evidence: OSV · GHSA-65fr-j4p9-vc33
View original version evidence (66 explicit versions)
Original source description
Impact
Passing untrusted input as part of a database or collection name may result in targeting a different database or collection than specified.
Patches
Fixed in PHP library 1.21.4 and 2.4.1.
Workarounds
Validate database and collection names prior to passing into APIs.
References
- Security advisory github.com/mongodb/mongo-php-library/security/advisories/GHSA-65fr-j4p9-vc33
- Security advisory nvd.nist.gov/vuln/detail/CVE-2026-81525
- Patch github.com/mongodb/mongo-php-library/pull/1967
- Patch github.com/mongodb/mongo-php-library/pull/1968
- Patch github.com/mongodb/mongo-php-library/commit/3a462213bb4fd46efa58a1937b06b1b0553b67a7
- Patch github.com/mongodb/mongo-php-library/commit/6f305a3b21740080255a3093b12458274c7cc8ca
- Release notes github.com/mongodb/mongo-php-driver/releases/tag/1.21.6
- Release notes github.com/mongodb/mongo-php-driver/releases/tag/1.21.7
- Release notes github.com/mongodb/mongo-php-driver/releases/tag/2.4.1
- Source reference github.com/mongodb/mongo-php-library
- Release notes github.com/mongodb/mongo-php-library/releases/tag/1.21.4
- Release notes github.com/mongodb/mongo-php-library/releases/tag/2.4.1
- Source reference jira.mongodb.org/browse/PHPLIB-1927