CVE-2026-142650: Laravel: SQL Injection in Laravel PostgreSQL Query Grammar
Laravel is a web application framework. Prior to 13.24.0 and 12.67.0, Laravel's PostgreSQL Query Grammar does not escape embedded single quotes in JSON path attributes when compiling non-raw Query Builder APIs. A user-influenced JSON path / identifier segment can break out of the single-quoted SQL string literal context used by PostgreSQL JSON operators. This can lead to SQL structure injection and WHERE-condition manipulation when an application passes user-influenced JSON path input into affected Query Builder APIs. This issue is fixed in versions 13.24.0 and 12.67.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 13.24.0 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 12.67.0
Event History
Frequently Asked Questions
Which applications are exposed to this issue?
Applications using Laravel's PostgreSQL Query Grammar before 13.24.0 or 12.67.0 are exposed only where user-influenced JSON path or identifier segments are passed to affected non-raw Query Builder APIs.
What does an attacker need to exploit it?
An attacker needs influence over a JSON path or identifier segment used by the application in an affected Query Builder call. Exploitation depends on the application passing that input into the query construction path; the attack complexity is rated high and requires high privileges.
What is the impact of successful exploitation?
Embedded single quotes in a JSON path attribute can break out of the PostgreSQL JSON operator's single-quoted string context. This can enable SQL structure injection and manipulation of WHERE conditions, with high confidentiality and integrity impact.
What should teams do if they cannot upgrade immediately?
Avoid passing user-influenced JSON path or identifier segments to the affected non-raw Query Builder APIs. Upgrade Laravel to 13.24.0 or 12.67.0 when possible.