GHSA-4mg9-vhxq-vm7j: Laravel/framework SQL Injection Vulnerability
HIGHGHSA-4mg9-vhxq-vm7j 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 sql server limit / offset sql injection in laravel/framework and illuminate/database. Remediation is available by upgrading affected packages to version 8.40.0, 6.20.26.
GHSA-4mg9-vhxq-vm7j at a Glance
How to Fix GHSA-4mg9-vhxq-vm7j
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 8.40.0
Upgrade laravel/framework to 6.20.26
Upgrade illuminate/database to 8.40.0
Upgrade illuminate/database to 6.20.26
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-4mg9-vhxq-vm7j, 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 8.40.0), 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-4mg9-vhxq-vm7j Affected Laravel/framework Versions
4 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
laravel/framework
|
Packagist |
≥ 8.0.0
< 8.40.0
|
8.40.0
|
|
laravel/framework
|
Packagist |
< 6.20.26
|
6.20.26
|
|
illuminate/database
|
Packagist |
≥ 8.0.0
< 8.40.0
|
8.40.0
|
|
illuminate/database
|
Packagist |
< 6.20.26
|
6.20.26
|
References
Frequently Asked Questions
What is GHSA-4mg9-vhxq-vm7j?
Which Laravel/framework versions are affected?
What version fixes GHSA-4mg9-vhxq-vm7j?
Is laravel/framework affected?
Is illuminate/database affected?
What CWE is associated with GHSA-4mg9-vhxq-vm7j?
How can I check Packagist dependencies for GHSA-4mg9-vhxq-vm7j?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4mg9-vhxq-vm7j",
"modified" : "2021-11-18T19:46:31Z",
"published" : "2021-04-29T21:52:53Z",
"aliases" : [ ],
"summary" : "SQL Server LIMIT / OFFSET SQL Injection in laravel/framework and illuminate/database",
"details" : "### Impact\n\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\n\nThis problem has been patched on Laravel versions 6.20.26, 7.30.5, and 8.40.0.\n\n### Workarounds\n\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.\n",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "laravel/framework"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "8.40.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "laravel/framework"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "6.20.26"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "illuminate/database"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "8.40.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "illuminate/database"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "6.20.26"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/laravel/framework/security/advisories/GHSA-4mg9-vhxq-vm7j"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/laravel/framework"
}, {
"type" : "WEB",
"url" : "https://packagist.org/packages/illuminate/database"
}, {
"type" : "WEB",
"url" : "https://packagist.org/packages/laravel/framework"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-89" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-04-28T20:17:07Z",
"nvd_published_at" : null
}
}