CVE-2025-61597
Executive Summary
CVE-2025-61597 is a stored Cross-Site Scripting (XSS) vulnerability in Emlog, an open-source website building system, affecting versions 2.5.21 and below. The flaw resides in the mail template settings, where an attacker with admin privileges can inject arbitrary HTML and JavaScript. Once saved, the payload executes on every subsequent visit to the settings page, enabling session/token theft and full admin account takeover. The vulnerability is fixed in version 2.5.22. With a CVSS score of 7.6, this is a high-severity issue that requires immediate patching.
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 CMS. The vulnerability is introduced through the core application code, not through third-party packages. However, administrators should verify the integrity of their Emlog installation and ensure no malicious modifications have been made.
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): High (H) – An attacker must have admin-level access.
- User Interaction (UI): Required (R) – The admin must visit the settings page.
- Scope (S): Changed (C) – The impact extends beyond the vulnerable component.
- Confidentiality (C): High (H) – Full session/token theft is possible.
- Integrity (I): Low (L) – Limited ability to modify data.
- Availability (A): Low (L) – Limited impact on availability.
Threat Level: High. While the attack requires admin privileges, the potential for full account takeover makes this a critical risk for any Emlog deployment.
Deep Dive & Mechanics
The vulnerability exists in the mail template settings functionality. Emlog allows administrators to customize email templates (e.g., for user registration, password reset). The input fields for these templates are not properly sanitized or encoded before being stored in the database and later rendered in the admin panel.
When an admin saves a malicious payload (e.g., <script>alert('XSS')</script>) into a mail template field, the payload is stored in the database. On subsequent visits to the mail template settings page, the stored payload is rendered without proper escaping, causing the browser to execute the injected JavaScript.
The attack flow:
- Attacker gains admin credentials (via phishing, credential stuffing, or other means).
- Attacker navigates to the mail template settings page.
- Attacker injects a malicious JavaScript payload into one of the template fields.
- The payload is stored in the database.
- Any admin (including the attacker) visiting the settings page triggers the payload.
- The payload can steal session cookies, CSRF tokens, or perform actions on behalf of the admin.
Vulnerable vs. Patched Code
Vulnerable Code (v2.5.21 and below):
// In the mail template settings page, the stored template is echoed directly
echo $template_content;
Patched Code (v2.5.22):
// The template content is now escaped using htmlspecialchars
echo htmlspecialchars($template_content, ENT_QUOTES, 'UTF-8');
The fix ensures that any HTML/JavaScript in the template content is rendered as text, not executed.
Exploitation & Lab Setup
Red Team
Prerequisites:
- Admin credentials for an Emlog instance (v2.5.21 or below).
- Access to the mail template settings page (typically
/admin/mail_template.php).
Exploitation Steps:
- Log in as an admin.
- Navigate to the mail template settings page.
- In one of the template fields (e.g., "User Registration Email"), inject the following payload:
<script> fetch('/admin/ajax.php?action=steal_session', { method: 'POST', body: JSON.stringify({cookie: document.cookie}) }); </script> - Save the template.
- Any admin visiting the settings page will trigger the payload, sending their session cookie to the attacker's server.
Note: No public exploit code is available at this time.
Blue Team
Detection:
- Monitor for unusual changes to mail template settings.
- Look for JavaScript code in template fields during audits.
- Use the detection rules provided below.
Prevention:
- Immediately upgrade to Emlog v2.5.22.
- Implement strict input validation and output encoding for all user-supplied data.
- Use Content Security Policy (CSP) headers to mitigate XSS.
Indicators of Compromise (IOCs)
- Network: Outbound connections to unknown IPs/domains from the Emlog admin panel.
- File: Modified mail template files in the database (check for
<script>tags). - Log: Unusual admin activity, especially changes to mail templates.
- Session: Unexpected session tokens or multiple active sessions for the same user.
Detection Engineering
YARA Rule
rule CVE_2025_61597_Emlog_XSS {
meta:
description = "Detects stored XSS payloads in Emlog mail templates"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-61597"
strings:
$xss_payload = /<script[\s>]/ nocase
$template_field = /mail_template/i
condition:
$xss_payload and $template_field
}
Sigma Rule
title: Emlog Mail Template XSS Detection
id: 8f7a3b2c-1d4e-5f6a-7b8c-9d0e1f2a3b4c
status: experimental
description: Detects potential XSS payloads in Emlog mail template settings
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
http.method: POST
http.url: '/admin/mail_template.php'
http.body|contains: '<script'
condition: selection
falsepositives:
- Legitimate use of JavaScript in templates (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-61597 Emlog Mail Template XSS"; flow:to_server; content:"POST"; http_method; content:"/admin/mail_template.php"; http_uri; content:"<script"; http_client_body; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade Emlog to version 2.5.22 or later.
- If upgrade is not possible, manually apply the patch by adding
htmlspecialchars()to all template output fields. - Review all admin accounts for unauthorized access.
- Rotate all admin passwords and session tokens.
Long-term Measures:
- Implement a Web Application Firewall (WAF) with XSS detection rules.
- Conduct regular security audits of the Emlog installation.
- Enforce least privilege for admin accounts.
- Enable logging and monitoring for all admin actions.
Valters IT Signature
This report was generated by Valters IT Cyber Threat Intelligence. For further assistance, contact threatintel@valtersit.com.