CVE-2024-40075
Executive Summary
CVE-2024-40075 identifies an XML External Entity (XXE) vulnerability in Laravel v11.x. This flaw allows an attacker to exploit XML parsing functionality to read arbitrary files, perform server-side request forgery (SSRF), or cause a denial of service (DoS) by injecting malicious XML entities. The vulnerability is currently unpatched, and no official fix has been released by the vendor. The EPSS score is 0.0%, indicating low exploitation activity in the wild, but the risk remains significant for applications processing untrusted XML input.
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
Laravel is a PHP framework distributed via Composer. This vulnerability affects the core framework's XML handling, potentially impacting any Laravel v11.x application that processes XML data. The lack of a patch means developers must implement manual mitigations or restrict XML parsing features.
CVSS Breakdown & Threat Level
The CVSS score is 0.0, but based on the nature of XXE vulnerabilities, a realistic assessment would be:
- Attack Vector (AV): Network (N)
- Attack Complexity (AC): Low (L)
- Privileges Required (PR): None (N)
- User Interaction (UI): None (N)
- Scope (S): Unchanged (U)
- Confidentiality (C): High (H)
- Integrity (I): None (N)
- Availability (A): Low (L)
Estimated CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:L
Estimated Score: 7.5 (High)
Deep Dive & Mechanics
The vulnerability lies in Laravel's XML parsing components, likely within the Illuminate\Support\Facades\Xml or related classes. When an application processes XML input without disabling external entity resolution, an attacker can craft a malicious XML payload that references external entities.
Example malicious XML payload:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [
<!ENTITY xxe SYSTEM "file:///etc/passwd">
]>
<root>&xxe;</root>
This payload, when parsed by a vulnerable Laravel application, will attempt to read the /etc/passwd file and include its contents in the response. The vulnerability is triggered because the XML parser is configured to resolve external entities by default.
Vulnerable vs. Patched Code
Vulnerable Code (Laravel v11.x):
// Example of vulnerable XML parsing
$xml = simplexml_load_string($input);
// or
$xml = new SimpleXMLElement($input);
Patched Code (Hypothetical fix):
// Disable external entity loading
libxml_disable_entity_loader(true);
$xml = simplexml_load_string($input);
// or
$xml = new SimpleXMLElement($input);
The fix involves disabling external entity loading before parsing XML. Since no official patch exists, developers must implement this manually.
Exploitation & Lab Setup
Red Team
Lab Setup:
- Install Laravel v11.x on a local server.
- Create a route that accepts XML input and parses it.
- Use a tool like Burp Suite or cURL to send malicious XML payloads.
Exploitation Steps:
- Identify an endpoint that processes XML data.
- Send a POST request with the malicious XML payload.
- Observe the response for file contents or error messages.
Example cURL command:
curl -X POST http://target.com/xml-endpoint \
-H "Content-Type: application/xml" \
-d '<?xml version="1.0"?>
<!DOCTYPE foo [
<!ENTITY xxe SYSTEM "file:///etc/passwd">
]>
<root>&xxe;</root>'
Blue Team
Detection:
- Monitor for XML payloads containing
<!ENTITY,SYSTEM, orfile://patterns. - Use WAF rules to block suspicious XML content.
- Enable logging of XML parsing errors.
Mitigation:
- Disable external entity loading in all XML parsers.
- Validate and sanitize XML input.
- Use a whitelist of allowed XML structures.
Indicators of Compromise (IOCs)
- Network: HTTP requests with
Content-Type: application/xmlcontaining<!ENTITYorSYSTEMkeywords. - File System: Unexpected access to
/etc/passwd,/etc/shadow, or other sensitive files. - Logs: XML parsing errors like "failed to load external entity" or "Entity: line 1: parser error".
- Process: Unusual outbound connections from the web server to internal or external hosts.
Detection Engineering
YARA Rule
rule CVE_2024_40075_XXE_Laravel {
meta:
description = "Detects XXE payloads targeting Laravel v11.x"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-40075"
strings:
$xxe1 = "<!ENTITY" nocase
$xxe2 = "SYSTEM" nocase
$xxe3 = "file://" nocase
$xxe4 = "php://" nocase
$xxe5 = "expect://" nocase
condition:
any of ($xxe*) and #xxe1 > 0
}
Sigma Rule
title: CVE-2024-40075 XXE Attempt in Laravel
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects HTTP requests with XXE payloads targeting Laravel v11.x
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-content-type: 'application/xml'
cs-uri-query|contains:
- '<!ENTITY'
- 'SYSTEM'
- 'file://'
condition: selection
falsepositives:
- Legitimate XML processing with external entities
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-40075 XXE Attempt in Laravel"; flow:to_server; content:"POST"; http_method; content:"application/xml"; http_content_type; content:"<!ENTITY"; within:100; content:"SYSTEM"; within:100; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Disable external entity loading in all XML parsers using
libxml_disable_entity_loader(true). - Short-term: Implement input validation to reject XML containing
<!DOCTYPE,<!ENTITY, orSYSTEMdeclarations. - Long-term: Monitor Laravel's official channels for a patch and apply it as soon as available.
- Alternative: Use JSON instead of XML for data exchange where possible.
- WAF: Deploy web application firewall rules to block XXE payloads.
Valters IT
Securing Digital Frontiers
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.