CVE-2024-29318
Executive Summary
CVE-2024-29318 is a stored cross-site scripting (XSS) vulnerability in Volmarg Personal Management System version 1.4.64. The application fails to sanitize SVG file uploads, allowing an authenticated attacker to inject arbitrary JavaScript code that executes in the context of any user viewing the uploaded file. This can lead to session hijacking, credential theft, or further compromise of the management system.
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 is a standalone PHP application, not an NPM, PyPI, Go, or Ruby package. No supply chain implications are present.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The vulnerability is exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): Low (L) – An attacker must have a valid account.
- User Interaction (UI): Required (R) – A victim must view the malicious SVG.
- Scope (S): Changed (C) – The impact extends beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure possible.
- Integrity (I): Low (L) – Limited ability to modify data.
- Availability (A): None (N) – No impact on availability.
CVSS Score: 5.4 (Medium)
Threat Level: Medium. Exploitation requires authentication, but the impact is significant for internal users.
Deep Dive & Mechanics
The vulnerability resides in the file upload functionality of Volmarg Personal Management System 1.4.64. The application allows users to upload SVG images for profile pictures or document attachments. The uploaded SVG file is not sanitized for embedded JavaScript, such as <script> tags or event handlers like onload.
When a victim views the uploaded SVG (e.g., in a profile page or document viewer), the browser executes the embedded script in the context of the application's origin. This enables the attacker to:
- Steal session cookies.
- Perform actions on behalf of the victim.
- Redirect to phishing pages.
- Deface the application.
The root cause is the lack of input validation and output encoding for SVG files. The application should either strip script elements from SVGs or serve them with a Content-Type: text/plain header.
Vulnerable vs. Patched Code
Vulnerable Code (1.4.64): The file upload handler likely uses a simple MIME type check or no check at all, allowing SVG files to be stored and served directly.
// Vulnerable upload handler (pseudocode)
if (isset($_FILES['file'])) {
$target = 'uploads/' . basename($_FILES['file']['name']);
move_uploaded_file($_FILES['file']['tmp_name'], $target);
// No sanitization of SVG content
}
Patched Code (Hypothetical):
A secure implementation would sanitize the SVG using a library like enshrined/svg-sanitize or serve the file with a non-executable content type.
// Patched upload handler (pseudocode)
require_once 'vendor/autoload.php';
use enshrined\svgSanitize\Sanitizer;
if (isset($_FILES['file'])) {
$sanitizer = new Sanitizer();
$cleanSvg = $sanitizer->sanitize(file_get_contents($_FILES['file']['tmp_name']));
$target = 'uploads/' . uniqid() . '.svg';
file_put_contents($target, $cleanSvg);
}
Exploitation & Lab Setup
Red Team
- Prerequisites: Valid user account on the Volmarg Personal Management System.
- Craft Malicious SVG: Create an SVG file with embedded JavaScript.
<?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');
</script>
</svg>
- Upload SVG: Log in, navigate to profile settings or document upload, and upload the SVG file.
- Trigger: Share the link to the uploaded SVG with a victim. When they view it, the script executes.
Blue Team
- Detection: Monitor file upload logs for SVG files with suspicious content (e.g.,
<script>tags). - Prevention: Implement a Web Application Firewall (WAF) rule to block SVG uploads containing JavaScript.
- Response: If an SVG upload is detected, immediately remove the file and invalidate the user's session.
Indicators of Compromise (IOCs)
- File Hashes (SHA-256): (Example – actual hash depends on payload)
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
- Network Traffic: HTTP POST requests to
/upload.phpor similar endpoints withContent-Type: image/svg+xml. - Log Entries: Access logs showing requests to
/uploads/malicious.svgwith aRefererheader from the application. - File Artifacts: SVG files in the uploads directory containing
<script>tags or event handlers.
Detection Engineering
YARA Rule
rule CVE_2024_29318_SVG_XSS {
meta:
description = "Detects malicious SVG files with embedded JavaScript for CVE-2024-29318"
author = "Valters IT"
date = "2024-01-01"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-29318"
strings:
$svg_header = "<?xml" nocase
$svg_tag = "<svg" nocase
$script_tag = "<script" nocase
$onload = "onload=" nocase
$onerror = "onerror=" nocase
condition:
$svg_header and $svg_tag and ($script_tag or $onload or $onerror)
}
Sigma Rule
title: CVE-2024-29318 SVG Upload with Embedded Script
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects upload of SVG files containing JavaScript code
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/upload.php'
cs-content-type: 'image/svg+xml'
condition: selection
falsepositives:
- Legitimate SVG files with metadata scripts
level: medium
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-29318 SVG XSS Upload Attempt"; flow:to_server; content:"POST"; http_method; content:"/upload.php"; http_uri; content:"image/svg+xml"; http_content_type; content:"<script"; within:1000; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Disable SVG file uploads in the application configuration.
- Short-term: Implement server-side sanitization of SVG files using a library like
enshrined/svg-sanitize. - Long-term: Upgrade to a patched version of the software if the vendor releases one.
- Compensating Controls:
- Serve uploaded files from a separate domain or subdomain.
- Set
Content-Disposition: attachmentheader to force download instead of inline rendering. - Use a Content Security Policy (CSP) to block inline scripts.
Valters IT
Securing Digital Frontiers