laravel framework SQL Injection via limit and offset functions
Published 15 May 2024 · Updated 29 Nov 2024
Affected packages
- Affected
- >=6.0.0 <6.20.26
- Fixed in
- 6.20.26
composer require laravel/framework:^6.20.26- Affected
- >=7.0.0 <7.30.5
- Fixed in
- 7.30.5
composer require laravel/framework:^7.30.5- Affected
- >=8.0.0 <8.40.0
- Fixed in
- 8.40.0
composer require laravel/framework:^8.40.0Details
Impact
Those using SQL Server with Laravel and allowing user input to be passed directly to the limit and offset functions are vulnerable to SQL injection. Other database drivers such as MySQL and Postgres are not affected by this vulnerability.
Patches
This problem has been patched on Laravel versions 6.20.26, 7.30.5, and 8.40.0.
Workarounds
You may workaround this vulnerability by ensuring that only integers are passed to the limit and offset functions, as well as the skip and take functions.
Is GHSA-wq8p-mqvg-2p5h in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected laravel/framework, and gives you the command that fixes it.
References
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.