MongoDB: GridFS data disclosure and deletion via query-operator injection in file IDs
Published 5 Oct 2026 · Updated 9 Nov 2026
Is your project on an affected mongodb/mongodb?
Look after several Laravel or PHP apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected packages
- Affected
- >=1.1.0 <1.21.5
- Fixed in
- 1.21.5
composer require mongodb/mongodb:^1.21.5- Affected
- >=2.0.0 <2.4.2
- Fixed in
- 2.4.2
composer require mongodb/mongodb:^2.4.2Details
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
https://jira.mongodb.org/browse/PHPLIB-1929
Is GHSA-8fxw-fmj8-xp7j in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected mongodb/mongodb, and gives you the command that fixes it.
More advisories for mongodb/mongodb
- HighCVE-2026-81525mongodb: Reject "." and NUL bytes in database and collection names · 8 Sept 2026
- MediumCVE-2021-32050MongoDB Driver may publish events containing authentication-related data · 29 Aug 2023
References
- Linkgithub.com/mongodb/mongo-php-library/security/advisories/GHSA-8fxw-fmj8-xp7j
- Advisorynvd.nist.gov/vuln/detail/CVE-2026-88023
- Linkgithub.com/mongodb/mongo-php-library/pull/1981
- Linkgithub.com/mongodb/mongo-php-library/commit/8c0b165069ab29d52a80a379a947ac9a55734601
- Packagegithub.com/mongodb/mongo-php-library
- Linkgithub.com/mongodb/mongo-php-library/releases/tag/1.21.5
- Linkgithub.com/mongodb/mongo-php-library/releases/tag/2.4.2
- Linkjira.mongodb.org/browse/PHPLIB-1929
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.