GHSA-wq8p-mqvg-2p5h: Laravel/framework SQL Injection Vulnerability
HIGHGHSA-wq8p-mqvg-2p5h is a HIGH sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Laravel/framework libraries in the Packagist ecosystem. The issue involves laravel framework sql injection via limit and offset functions. Remediation is available by upgrading affected packages to version 6.20.26, 7.30.5, 8.40.0.
GHSA-wq8p-mqvg-2p5h at a Glance
How to Fix GHSA-wq8p-mqvg-2p5h
To remediate this vulnerability, upgrade all affected Laravel/framework dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade laravel/framework to 6.20.26
Upgrade laravel/framework to 7.30.5
Upgrade laravel/framework to 8.40.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for laravel/framework
How to Check if You Are Affected
To determine whether your application is affected by GHSA-wq8p-mqvg-2p5h, inspect your project dependencies for Laravel/framework:
inspect dependencies for laravel/framework
Analyze the terminal output to locate any version of Laravel/framework in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.20.26), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Laravel/framework, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-wq8p-mqvg-2p5h Affected Laravel/framework Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
laravel/framework
|
Packagist |
≥ 6.0.0
< 6.20.26
|
6.20.26
|
|
laravel/framework
|
Packagist |
≥ 7.0.0
< 7.30.5
|
7.30.5
|
|
laravel/framework
|
Packagist |
≥ 8.0.0
< 8.40.0
|
8.40.0
|
References
Frequently Asked Questions
What is GHSA-wq8p-mqvg-2p5h?
Which Laravel/framework versions are affected?
What version fixes GHSA-wq8p-mqvg-2p5h?
Is laravel/framework affected?
What CWE is associated with GHSA-wq8p-mqvg-2p5h?
How can I check Packagist dependencies for GHSA-wq8p-mqvg-2p5h?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-wq8p-mqvg-2p5h",
"modified" : "2024-05-15T22:20:42Z",
"published" : "2024-05-15T22:20:42Z",
"aliases" : [ ],
"summary" : "laravel framework SQL Injection via limit and offset functions",
"details" : "### Impact\nThose 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.\n\n### Patches\nThis problem has been patched on Laravel versions 6.20.26, 7.30.5, and 8.40.0.\n\n### Workarounds\nYou 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.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "laravel/framework"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.0.0"
}, {
"fixed" : "6.20.26"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "laravel/framework"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "7.0.0"
}, {
"fixed" : "7.30.5"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "laravel/framework"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "8.40.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/laravel/framework/security/advisories/GHSA-4mg9-vhxq-vm7j"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/laravel/framework/2021-04-28.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/laravel/framework"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-89" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-05-15T22:20:42Z",
"nvd_published_at" : null
}
}