GHSA-2ffv-r4r9-r8xr: Illuminate/cookie Remote Code Execution Vulnerability
CRITICALGHSA-2ffv-r4r9-r8xr is a CRITICAL remote code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Illuminate/cookie libraries in the Packagist ecosystem. The issue involves laravel rce vulnerability in "cookie" session driver. Remediation is available by upgrading affected packages to version 6.18.31, 7.22.4.
GHSA-2ffv-r4r9-r8xr at a Glance
How to Fix GHSA-2ffv-r4r9-r8xr
To remediate this vulnerability, upgrade all affected Illuminate/cookie 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 illuminate/cookie to 6.18.31
Upgrade illuminate/cookie to 7.22.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for illuminate/cookie
How to Check if You Are Affected
To determine whether your application is affected by GHSA-2ffv-r4r9-r8xr, inspect your project dependencies for Illuminate/cookie:
inspect dependencies for illuminate/cookie
Analyze the terminal output to locate any version of Illuminate/cookie in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.18.31), 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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Illuminate/cookie, 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-2ffv-r4r9-r8xr Affected Illuminate/cookie Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
illuminate/cookie
|
Packagist |
≥ 4.1.0
< 6.18.31
|
6.18.31
|
|
illuminate/cookie
|
Packagist |
≥ 7.0.0
< 7.22.4
|
7.22.4
|
References
Frequently Asked Questions
What is GHSA-2ffv-r4r9-r8xr?
Which Illuminate/cookie versions are affected?
What version fixes GHSA-2ffv-r4r9-r8xr?
Is illuminate/cookie affected?
What CWE is associated with GHSA-2ffv-r4r9-r8xr?
How can I check Packagist dependencies for GHSA-2ffv-r4r9-r8xr?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-2ffv-r4r9-r8xr",
"modified" : "2024-05-15T21:52:29Z",
"published" : "2024-05-15T21:52:29Z",
"aliases" : [ ],
"summary" : "Laravel RCE vulnerability in \"cookie\" session driver",
"details" : "Application's using the \"cookie\" session driver were the primary applications affected by this vulnerability. Since we have not yet released a security release for the Laravel 5.5 version of the framework, we recommend that all applications running Laravel 5.5 and earlier do not use the \"cookie\" session driver in their production deployments.\n\nRegarding the vulnerability, applications using the \"cookie\" session driver that were also exposing an encryption oracle via their application were vulnerable to remote code execution. An encryption oracle is a mechanism where arbitrary user input is encrypted and the encrypted string is later displayed or exposed to the user. This combination of scenarios lets the user generate valid Laravel signed encryption strings for any plain-text string, thus allowing them to craft Laravel session payloads when an application is using the \"cookie\" driver.\n\nThis fix prefixes cookie values with an HMAC hash of the cookie's name before encryption and then verifies a matching hash on decryption, making it impossible to craft a valid cookie payload even if an encryption oracle is exposed via the application.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "illuminate/cookie"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.1.0"
}, {
"fixed" : "6.18.31"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "illuminate/cookie"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "7.0.0"
}, {
"fixed" : "7.22.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://blog.laravel.com/laravel-cookie-security-releases"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/illuminate/cookie/2020-07-27-1.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/illuminate/cookie"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2024-05-15T21:52:29Z",
"nvd_published_at" : null
}
}