Summary
A vulnerability (CWE-943) in the query builder of the MongoDB integration for Laravel allows values passed to the bulk counter-update helpers (incrementEach() and decrementEach()) to be interpreted by the database as query expressions rather than stored as plain text. Versions 4.8.0 up to, but not including, 5.12.2 are affected.
Per the CVSS vector (8.2, high), the attack is network-based, low complexity, and requires no authentication or user interaction. The precondition is that the application passes externally supplied data into these helpers.
An attacker may write unintended values into stored documents (limited integrity impact) and cause unintended disclosure of other data held in the same document (high confidentiality impact). The vulnerability is not listed in the CISA KEV catalog.
Who is affected
Organizations developing or running Laravel applications using the MongoDB integration (laravel-mongodb) versions 4.8.0 up to, but not including, 5.12.2.
What to do
- Upgrade the Laravel MongoDB integration to version 5.12.2 or later.
- Check the installed package version (e.g. in composer.lock) across all applications and environments.
- Review code for calls to incrementEach() and decrementEach() that receive user input or other external data.
- Until upgraded, strictly validate input values for these helpers (e.g. allow only expected numeric values).
- Follow the vendor's official advisory for details: https://jira.mongodb.org/browse/PHPLARA-310
Affected products and versions
CVSS vector, explained
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N
- Attack vector
- Network (from the internet)
- Attack complexity
- Low
- Privileges required
- None (no login)
- User interaction
- Not required
- Scope
- Vulnerable component only
- Confidentiality
- High impact
- Integrity
- Low impact
- Availability
- None
Weakness type (CWE)
- CWE-943 Improper Neutralization of Special Elements in Data Query Logic
References
Sources: CVE.org (CNA and CISA ADP), CISA KEV, FIRST EPSS. Always check the vendor's official advisory.