SQL Injection in Laravel PostgreSQL Query Grammar
Summary
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.
Im...
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| composerlaravel/framework |
<13.24.0→ >=13.24.0 |
>=13.24.0 |
| composerlaravel/framework |
<12.67.0→ >=12.67.0 |
>=12.67.0 |
Original description The description as published by the source.
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.
Impact
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.
Patches
Source: GitHub Repository Security Advisories (Game のスタック) GitHub Advisory OSV
References
- GITHUB_REPO_ADVISORY laravel/framework