GHSA-wq8p-mqvg-2p5h laravel framework SQL Injection via limit and offset functions
SQL injection vulnerability in Laravel when using SQL Server with user-controlled limit and offset parameters, allowing attackers to read or modify database data.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is GHSA-wq8p-mqvg-2p5h?
GHSA-wq8p-mqvg-2p5h is a SQL injection vulnerability in laravel/framework, published on 15 May 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
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.
Which versions are affected by GHSA-wq8p-mqvg-2p5h?
6 open source packages ship an affected version, including laravel/framework.
| Package | Affected | Fixed in |
|---|---|---|
laravel/framework Packagist | From 6.0.0 | 6.20.26 |
laravel/framework Packagist | From 6.0.0 | 6.20.26 |
laravel/framework Packagist | From 7.0.0 | 7.30.5 |
laravel/framework Packagist | From 7.0.0 | 7.30.5 |
laravel/framework Packagist | From 8.0.0 | 8.40.0 |
laravel/framework Packagist | From 8.0.0 | 8.40.0 |
How do I fix GHSA-wq8p-mqvg-2p5h?
Upgrade laravel/framework to a fixed version for your release line: 6.20.26, 7.30.5 or 8.40.0.
Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.
Is GHSA-wq8p-mqvg-2p5h being exploited?
There is no known exploitation of GHSA-wq8p-mqvg-2p5h in the wild and no public exploit code.