MongoDB: GridFS data disclosure and deletion via query-operator injection in file IDs
The advisory, in context
Impact
Improper neutralization of special elements in data query logic in the GridFS component of the MongoDB PHP Library can cause a caller-supplied structured file identifier to be interpreted as a query condition rather than as a literal identifier. An authenticated user who can influence the identifier passed by an affected application may obtain stored file content beyond the intended target or cause all GridFS file chunks in the affected bucket to be removed, rendering stored file content unreadable. The affected rename operation may also rename a stored file other than the intended target.
Patches
Fixed in 1.21.5 and 2.4.2.
Workarounds
Validate GridFS IDs.
References
Affected 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.
From 1.1.0 before 1.24.5
Fixed in 1.24.5
49 explicitly affected versions
1.1.0, 1.1.1, 1.1.2, 1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0, 1.13.0-beta1, 1.13.1, 1.15.0, 1.16.0, 1.16.1, 1.17.0, 1.17.1, 1.18.0, 1.19.0, 1.19.1, 1.2.0, 1.2.0-alpha1, 1.20.0, 1.21.0, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.3.0, 1.3.1, 1.3.2, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.5.1, 1.5.2, 1.6.0, 1.6.1, 1.7.0, 1.7.0-beta1, 1.7.0-beta2, 1.7.0-rc1, 1.7.1, 1.7.2, 1.8.0, 1.8.0-RC1, 1.9.0, 1.9.0-alpha1
View affected-version evidence
{
"ranges": [
{
"events": [
{
"introduced": "1.1.0"
},
{
"fixed": "1.24.5"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"1.1.0",
"1.1.1",
"1.1.2",
"1.10.0",
"1.10.1",
"1.11.0",
"1.12.0",
"1.13.0",
"1.13.0-beta1",
"1.13.1",
"1.15.0",
"1.16.0",
"1.16.1",
"1.17.0",
"1.17.1",
"1.18.0",
"1.19.0",
"1.19.1",
"1.2.0",
"1.2.0-alpha1",
"1.20.0",
"1.21.0",
"1.21.1",
"1.21.2",
"1.21.3",
"1.21.4",
"1.21.5",
"1.3.0",
"1.3.1",
"1.3.2",
"1.4.0",
"1.4.1",
"1.4.2",
"1.4.3",
"1.5.0",
"1.5.1",
"1.5.2",
"1.6.0",
"1.6.1",
"1.7.0",
"1.7.0-beta1",
"1.7.0-beta2",
"1.7.0-rc1",
"1.7.1",
"1.7.2",
"1.8.0",
"1.8.0-RC1",
"1.9.0",
"1.9.0-alpha1"
]
}From 2.0.0 before 2.4.2
Fixed in 2.4.2
8 explicitly affected versions
2.0.0, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.3.0, 2.4.0, 2.4.1
View affected-version evidence
{
"ranges": [
{
"events": [
{
"introduced": "2.0.0"
},
{
"fixed": "2.4.2"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"2.0.0",
"2.1.0",
"2.1.1",
"2.1.2",
"2.2.0",
"2.3.0",
"2.4.0",
"2.4.1"
]
}References
- https://github.com/mongodb/mongo-php-library/security/advisories/GHSA-8fxw-fmj8-xp7j
- https://nvd.nist.gov/vuln/detail/CVE-2026-88023
- https://github.com/mongodb/mongo-php-library/pull/1981
- https://github.com/mongodb/mongo-php-library/commit/8c0b165069ab29d52a80a379a947ac9a55734601
- https://github.com/mongodb/mongo-php-library
- https://github.com/mongodb/mongo-php-library/releases/tag/1.21.5
- https://github.com/mongodb/mongo-php-library/releases/tag/2.4.2
- https://jira.mongodb.org/browse/PHPLIB-1929