CVE-2024-22859
Executive Summary
CVE-2024-22859 describes a disputed Cross-Site Request Forgery (CSRF) vulnerability in the Livewire library for Laravel, affecting versions before v3.0.4. The vulnerability is claimed to allow remote attackers to execute arbitrary code via the getCsrfToken function. However, the vendor disputes this classification, stating that the referenced commit (5d88731) fixes a usability problem (HTTP 419 status codes for legitimate client activity) rather than a security flaw. The CVSS score is 0.0, indicating no official severity assessment, and the EPSS score is 0.0%, suggesting no active exploitation in the wild. No public proof-of-concept (PoC) or exploit code is available. The vulnerability is categorized under CWE-352 (Cross-Site Request Forgery).
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
Livewire is a PHP package distributed via Composer (Packagist). The disputed nature of this CVE means that while the package maintainers do not consider it a security issue, downstream consumers should evaluate the risk based on their own threat model. The package is widely used in Laravel applications, and any CSRF bypass could potentially lead to unauthorized actions on behalf of authenticated users.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- Base Score: 0.0 (Disputed)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: Required (UI:R)
- Scope: Unchanged (S:U)
- Confidentiality Impact: High (C:H)
- Integrity Impact: High (I:H)
- Availability Impact: High (A:H)
Threat Level: Low (Disputed, no active exploitation, no public PoC)
Deep Dive & Mechanics
The vulnerability is centered around the getCsrfToken function in Livewire. CSRF attacks typically trick an authenticated user into executing unwanted actions on a web application where they are authenticated. In this case, the claim is that an attacker could leverage the getCsrfToken function to bypass CSRF protections and execute arbitrary code. However, the vendor argues that the function is not intended for security-critical operations and that the fix in commit 5d88731 only addresses a usability issue where legitimate users received HTTP 419 status codes (CSRF token mismatch) during normal operations.
The disputed nature of this CVE means that the technical details are not fully validated. The vulnerability, if real, would require user interaction (e.g., clicking a malicious link) and could lead to full compromise of the application's CSRF protection, allowing attackers to perform state-changing operations on behalf of the victim.
Vulnerable vs. Patched Code
Vulnerable Code (before v3.0.4):
// Hypothetical vulnerable implementation of getCsrfToken
public function getCsrfToken()
{
return csrf_token();
}
Patched Code (v3.0.4, commit 5d88731):
// Patched version with additional validation
public function getCsrfToken()
{
// Added check to ensure the request is from a valid source
if ($this->isValidRequest()) {
return csrf_token();
}
abort(419);
}
Note: The exact code changes are not publicly available due to the dispute. The above is a hypothetical representation based on the described fix.
Exploitation & Lab Setup
Red Team
Since no public exploit code is available, a red team would need to craft a custom CSRF attack. The attack would involve:
- Identify a target running Livewire < 3.0.4.
- Craft a malicious HTML page that sends a request to the vulnerable endpoint, e.g.,
POST /livewire/message/{component}with a crafted payload. - Trick an authenticated user into visiting the malicious page.
- Execute arbitrary code via the
getCsrfTokenfunction (if the vulnerability is real).
Example CSRF PoC (hypothetical):
<html>
<body>
<form action="https://target.com/livewire/message/component" method="POST">
<input type="hidden" name="state" value="malicious_payload" />
<input type="submit" value="Submit" />
</form>
<script>
document.forms[0].submit();
</script>
</body>
</html>
Blue Team
To defend against this vulnerability:
- Update Livewire to v3.0.4 or later.
- Implement additional CSRF protections such as SameSite cookies and custom headers.
- Monitor for unusual CSRF token errors (HTTP 419) that may indicate exploitation attempts.
- Use Web Application Firewalls (WAF) to block suspicious requests.
Indicators of Compromise (IOCs)
- Network Indicators:
- Unusual POST requests to
/livewire/message/*endpoints with unexpected payloads. - Repeated HTTP 419 status codes from Livewire components.
- Unusual POST requests to
- File Indicators:
- Modified
livewire.jsorlivewire.phpfiles.
- Modified
- Log Indicators:
- CSRF token mismatch errors in application logs.
- Unauthorized state-changing actions performed by authenticated users.
Detection Engineering
YARA Rule
rule CVE_2024_22859_Livewire_CSRF {
meta:
description = "Detects potential exploitation of CVE-2024-22859 in Livewire"
author = "Valters IT"
date = "2024-01-01"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-22859"
strings:
$csrf_token = "getCsrfToken"
$livewire_js = "livewire.js"
$http_419 = "419"
condition:
$csrf_token or ($livewire_js and $http_419)
}
Sigma Rule
title: CVE-2024-22859 Livewire CSRF Exploitation Attempt
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects potential exploitation of CVE-2024-22859 in Livewire
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
c-uri|contains: '/livewire/message/'
sc-status: 419
condition: selection
falsepositives:
- Legitimate CSRF token expiration
level: medium
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-22859 Livewire CSRF Exploitation Attempt";
flow:to_server,established;
content:"POST"; http_method;
content:"/livewire/message/"; http_uri;
content:"419"; http_stat_code;
sid:1000001;
rev:1;
reference:cve,2024-22859;
)
Remediation & Mitigation
- Immediate Action: Update Livewire to version 3.0.4 or later. Run
composer update livewire/livewire. - Workaround: If updating is not possible, implement additional CSRF tokens or use Laravel's built-in CSRF protection with custom headers.
- Monitoring: Enable logging for CSRF token mismatches and monitor for unusual activity.
- Validation: Review the disputed nature of this CVE and assess risk based on your application's exposure.
Valters IT Signature This report was generated by Valters IT DevSecOps AI. For questions, contact security@valters-it.com.