GHSA-wq8p-mqvg-2p5h laravel framework SQL Injection via limit and offset functions

Not scored Published

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.

PackageAffectedFixed in
laravel/framework PackagistFrom 6.0.06.20.26
laravel/framework PackagistFrom 6.0.06.20.26
laravel/framework PackagistFrom 7.0.07.30.5
laravel/framework PackagistFrom 7.0.07.30.5
laravel/framework PackagistFrom 8.0.08.40.0
laravel/framework PackagistFrom 8.0.08.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.

Sources

Is GHSA-wq8p-mqvg-2p5h in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free