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

Laravel MongoDB (PHP Driver): incorrect authorization in whereDoesntHave morph-map handling

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

Summary

A polymorphic relationship query helper in the MongoDB Eloquent integration for Laravel resolves a record's type identifier inconsistently. The code that stores relationship links and the code that searches for them do not use the same identifier. As a result, restrictions based on relationship-absence queries (whereDoesntHave) can silently fail (CWE-863: Incorrect Authorization).

Per the CVSS vector (8.1, high), the attack is carried out over the network with low complexity. The attacker needs only basic application privileges, and no user interaction is required.

Successful exploitation lets the user read, modify or delete records the restriction was meant to protect. Confidentiality and integrity impact is high, with no availability impact. The vulnerability is not listed in CISA KEV.

Who is affected

Organizations running Laravel applications with the MongoDB Eloquent integration (PHP Driver) from 4.1.0 up to before 5.12.2, especially those relying on whereDoesntHave over morph-mapped polymorphic relations for access control.

What to do

  1. Upgrade the package to version 5.12.2 or later.
  2. Inventory applications and check whether a version between 4.1.0 and 5.12.2 is in use (e.g. composer show).
  3. Review code that uses whereDoesntHave on morph-mapped polymorphic relations to restrict access. Until you upgrade, add independent authorization checks.
  4. Review data access and change logs for unauthorized modifications or deletions.
  5. Follow the vendor advisory (https://jira.mongodb.org/browse/PHPLARA-320) for further guidance.

Affected products and versions

MongoDB PHP Driver4.1.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.