SQL Server LIMIT / OFFSET SQL Injection in laravel/framework and illuminate/database
Published 29 Apr 2021 · Updated 2 Dec 2024
Is your project on an affected laravel/framework?
Affected packages
- Affected
- >=8.0.0 <8.40.0
- Fixed in
- 8.40.0
composer require laravel/framework:^8.40.0- Affected
- <6.20.26
- Fixed in
- 6.20.26
composer require laravel/framework:^6.20.26- Affected
- >=8.0.0 <8.40.0
- Fixed in
- 8.40.0
composer require illuminate/database:^8.40.0- Affected
- <6.20.26
- Fixed in
- 6.20.26
composer require illuminate/database:^6.20.26Details
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-4mg9-vhxq-vm7j 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.
More advisories for laravel/framework
- CriticalCVE-2026-114509Laravel TokenGuard authentication bypass through non-string API credentials · 23 Oct 2026
- MediumCVE-2026-114508Laravel relationship inclusion can trigger unauthorized data destruction · 23 Oct 2026
- LowCVE-2026-102279Laravel: XSS in Debug Page Information · 29 Sept 2026
- MediumGHSA-crmm-hgp2-wgrpLaravel Framework: Temporary Signed URL Path Confusion · 17 Jun 2026
- HighCVE-2026-48019Laravel Framework: CRLF injection in default email rule · 17 Jun 2026
- MediumCVE-2024-13918Laravel framework susceptible to reflected cross-site scripting · 10 Mar 2025
References
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.