Incident response on call, 24/7: +385 98 1900 984NewIR Retainer: a team on contract before an attack
HR · EN
High 8.1CVE-2026-135144

Laravel MongoDB (PHP Driver): authorization bypass due to skipped beforeQuery callbacks

Published 25/11/2026 · Updated 25/11/2026 · MongoDB PHP Driver

Summary

The query builder component of the MongoDB integration library for a PHP web framework (Laravel) does not run the query-modification callbacks (beforeQuery) that an application registers with the framework. These callbacks are skipped before read, update and delete operations are sent to the database. As a result, a filter the application relies on to limit which records a request may touch can be silently omitted (CWE-862: Missing Authorization).

Per the CVSS vector (8.1, high severity), the attack is network-based and low in complexity. It requires an authenticated user with basic privileges and no user interaction. An attacker may read or modify records that were meant to be out of reach, with high impact on confidentiality and integrity. Availability is not affected.

The vulnerability is not listed in the CISA KEV catalog, and no EPSS data is available.

Who is affected

Organizations building or running Laravel applications with the MongoDB integration in versions 4.8.0 up to (but not including) 5.12.2. This matters most where beforeQuery callbacks are used to restrict data access, e.g. per-user or per-tenant scoping.

What to do

  1. Upgrade the Laravel MongoDB library to version 5.12.2 or later.
  2. Check composer.lock to identify the package version your applications use and whether it falls between 4.8.0 and before 5.12.2.
  3. Identify where the application uses beforeQuery callbacks to restrict record access. Until you upgrade, enforce explicit authorization conditions directly in queries or at the application layer.
  4. Review data access and modification logs for signs of unauthorized reads or changes.
  5. For further details, follow the vendor's official advisory: https://jira.mongodb.org/browse/PHPLARA-321

Affected products and versions

MongoDB PHP Driver4.8.0 – < 5.12.2Fixed in: 5.12.2

CVSS vector, explained

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N

Attack vector
Network (from the internet)
Attack complexity
Low
Privileges required
Regular user
User interaction
Not required
Scope
Vulnerable component only
Confidentiality
High impact
Integrity
High impact
Availability
None

Weakness type (CWE)

References

Sources: CVE.org (CNA and CISA ADP), CISA KEV, FIRST EPSS. Always check the vendor's official advisory.