Cloudanix VulnDB

CVE-2021-25296

High · 8.8 CISA KEV

CVSS

8.8

EPSS

71.9%

Published

Feb 15, 2021

CISA due date

Feb 1, 2022

Cloudanix analysis

Act now SSVC: Attend

A logged-in attacker could use a flaw in the monitoring server to run commands on it, potentially stealing credentials and using it to reach other systems.

Active In The Wild
Exploitation
Remote Authenticated
Attacker needs
Low Privilege
Complexity
Low
Impact
Remote Code Execution
Component
Application
Class
Command Injection
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

CVE-2021-25296 is an authenticated OS command injection vulnerability in Nagios XI 5.7.5 in the Windows WMI configuration wizard component at /usr/local/nagiosxi/html/includes/configwizards/windowswmi/windowswmi.inc.php. A low-privileged authenticated user can submit crafted input in a single HTTP request that is incorporated into an operating-system command without sufficient sanitization. Successful exploitation allows arbitrary command execution on the Nagios XI server with the privileges of the vulnerable web application or associated Nagios execution context, potentially enabling file access, credential theft, persistence, lateral movement, and full server compromise.

Why it matters to the business

A compromised Nagios XI server can be highly damaging because monitoring systems often have broad visibility into infrastructure, stored service credentials, network reachability, and privileged integrations. Exploitation may allow attackers to disrupt monitoring, hide outages or malicious activity, steal credentials used to monitor other systems, pivot deeper into the network, or deploy additional malware. This issue is listed in CISA KEV with a remediation due date of 2022-02-01 and has high EPSS likelihood with active exploitation in the wild, so any remaining vulnerable deployments should be treated as urgent legacy exposure.

How an attack unfolds

An attacker first obtains valid Nagios XI credentials, often through phishing, password reuse, default or weak credentials, credential theft, or compromise of another account with access to the Nagios XI web interface. After authentication, the attacker sends a crafted HTTP request to the Windows WMI configuration wizard endpoint, placing shell metacharacters or command payloads into a vulnerable user-controlled field. Because the server-side PHP code does not safely sanitize or escape the input before invoking an OS command, the injected payload is interpreted by the shell. The attacker can then run commands to enumerate the host, read configuration files, dump credentials, download web shells or reverse shells, create persistence, tamper with monitoring checks, and use the monitoring server’s network position to access downstream systems.

How to fix it

Upgrade Nagios XI to a vendor-supported version that includes the fix for this vulnerability; do not continue operating Nagios XI 5.7.5. Because exact fixed versions were not provided in the source data, use the latest stable Nagios XI release from the vendor and verify the release notes identify remediation for the Windows WMI configuration wizard command injection issue. If immediate upgrade is not possible, restrict access to the Nagios XI web interface to trusted administrative networks or VPNs, disable or remove access to the Windows WMI configuration wizard where operationally feasible, enforce least-privilege accounts, rotate credentials stored in Nagios XI, and monitor for suspicious requests to the vulnerable endpoint. Treat mitigation as temporary because network restrictions do not remove the vulnerable code path for authenticated users.

How to confirm the fix worked

Confirm the installed Nagios XI version is newer than the vulnerable 5.7.5 release and is within a currently supported vendor branch. Verify that the vulnerable file has been updated or replaced by the vendor package and that the Windows WMI wizard no longer passes unsanitized user input into shell commands. Review web server access logs to ensure the endpoint /includes/configwizards/windowswmi/windowswmi.inc.php is not reachable by untrusted users. In a controlled test environment only, validate that shell metacharacters in the relevant wizard inputs are rejected, safely encoded, or treated as literal text rather than executed. Also confirm compensating controls such as MFA, restricted admin access, and web interface network allowlisting are active.

Typical attack path

  1. Identify an internet-accessible or internally reachable Nagios XI instance running a vulnerable version such as 5.7.5.
  2. Acquire valid Nagios XI credentials or compromise an account with access to configuration wizard functionality.
  3. Authenticate to the Nagios XI web interface.
  4. Send a crafted request to the Windows WMI configuration wizard endpoint containing OS command injection syntax.
  5. Execute reconnaissance commands on the Nagios XI server to determine user context, hostname, network interfaces, and accessible files.
  6. Steal Nagios XI configuration data, monitoring credentials, API keys, or stored secrets.
  7. Download and execute additional tooling, web shells, reverse shells, or persistence mechanisms.
  8. Use the monitoring server’s trusted access to pivot to monitored hosts or suppress monitoring alerts to conceal activity.

How to detect it

Investigate historical exploitation by reviewing web server logs, Nagios XI application logs, authentication logs, process execution telemetry, file integrity data, and network egress records. Focus on authenticated requests to the Windows WMI configuration wizard endpoint, especially requests containing shell metacharacters, URL-encoded command separators, command substitution, download commands, or unusually long parameter values. Correlate suspicious requests with new child processes spawned by httpd, apache, php, nagios, or related Nagios XI components. Look for commands such as id, whoami, uname, curl, wget, bash, sh, nc, python, perl, chmod, crontab, useradd, or reverse-shell patterns. Review Nagios XI audit trails for unusual configuration wizard activity, newly created users, changed notification commands, modified check commands, disabled monitoring, or unexpected administrative actions. Examine the filesystem for recently modified PHP files under the Nagios XI web root, unexpected files in writable directories, new cron jobs, SSH authorized_keys changes, suspicious binaries in /tmp or /var/tmp, and outbound connections from the Nagios XI server to unfamiliar IP addresses. If the server was vulnerable during the KEV exploitation window or exposed to untrusted users, assume log review must cover the full period of exposure because exploitation requires only one authenticated request.

  • /usr/local/nagiosxi/html/includes/configwizards/windowswmi/windowswmi.inc.php
  • /includes/configwizards/windowswmi/windowswmi.inc.php
  • windowswmi.inc.php
  • GET /nagiosxi/includes/configwizards/windowswmi/windowswmi.inc.php
  • POST /nagiosxi/includes/configwizards/windowswmi/windowswmi.inc.php
  • %3B
  • %7C
  • %60
  • %24%28
  • ;whoami
  • ;id
  • ;uname
  • |whoami
  • |id
  • `whoami`
  • $(whoami)
  • curl http
  • wget http
  • bash -c
  • sh -c
  • nc -e
  • /bin/bash -i
  • /dev/tcp/
  • python -c
  • perl -e
  • php -r
  • chmod +x /tmp
  • /tmp/
  • /var/tmp/
  • httpd.*bash
  • httpd.*sh
  • httpd.*curl
  • httpd.*wget
  • apache.*bash
  • apache.*sh
  • nagios.*bash
  • nagios.*sh

What your security team should do

  • Immediately inventory all Nagios XI deployments and identify any instance running version 5.7.5 or other unsupported legacy releases.
  • Patch or upgrade vulnerable Nagios XI servers to the latest supported vendor release, prioritizing internet-facing systems and systems accessible by broad internal user groups.
  • Because this vulnerability is in CISA KEV and has active exploitation in the wild, perform compromise assessment on any historically vulnerable instance rather than treating patching alone as sufficient.
  • Restrict Nagios XI web access to trusted administrative networks, VPN, or bastion hosts; do not expose it directly to the internet.
  • Review Nagios XI users for unnecessary access, remove stale accounts, enforce MFA where available, and reset passwords for accounts with configuration privileges.
  • Rotate credentials, API tokens, SNMP communities, Windows credentials, SSH keys, and other secrets stored or used by Nagios XI if exploitation is suspected or cannot be ruled out.
  • Search web, application, process, and authentication logs for suspicious access to the Windows WMI wizard endpoint and command-execution artifacts.
  • Monitor for child processes spawned by the web server or Nagios XI components, especially shells, download utilities, scripting runtimes, and network tools.
  • Preserve forensic evidence before rebuilding or upgrading if compromise is suspected, including web logs, Nagios XI logs, shell histories, cron entries, uploaded files, and process telemetry.
  • Consider rebuilding the Nagios XI server from trusted media if there are signs of arbitrary command execution, persistence, web shells, or credential theft.

The record

Nagios XI version xi-5.7.5 is affected by OS command injection. The vulnerability exists in the file /usr/local/nagiosxi/html/includes/configwizards/windowswmi/windowswmi.inc.php due to improper sanitization of authenticated user-controlled input by a single HTTP request, which can lead to OS command injection on the Nagios XI server.

Affected packages

Ecosystem Package Introduced Fixed