What’s Vulnerable › Vulnerabilities
GHSA-4mg9-vhxq-vm7j: SQL Server LIMIT / OFFSET SQL Injection in laravel/framework and illuminate/database
- Severity: high (CVSS 7.5)
- Exploited in the wild: not listed in CISA KEV
- Public exploit or detection template: none known
- Published: 2021-04-29 · updated 2024-12-02
- Weakness: CWE-89
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.
Affected products
- Packagist Illuminate/Database: from 8.0.0 before 8.40.0; before 6.20.26; v8.0.0, v8.0.1, v8.0.2, v8.0.3, v8.0.4, v8.1.0 (+368) — fixed in 8.40.0, 6.20.26
- Packagist Laravel/Framework: from 8.0.0 before 8.40.0; before 6.20.26; v8.0.0, v8.0.1, v8.0.2, v8.0.3, v8.0.4, v8.1.0 (+559) — fixed in 8.40.0, 6.20.26
How to fix
Upgrade to a fixed version: Packagist Illuminate/Database 8.40.0, 6.20.26; Packagist Laravel/Framework 8.40.0, 6.20.26. Check the vendor advisory for mitigations.
References
- https://github.com/laravel/framework/security/advisories/GHSA-4mg9-vhxq-vm7j
- https://github.com/laravel/framework
- https://packagist.org/packages/illuminate/database
- https://packagist.org/packages/laravel/framework
Get alerted when GHSA-4mg9-vhxq-vm7j or the next vulnerability affects your stack