Aug 19, 2026·6 min read·0 visits
Authenticated administrators can execute arbitrary system commands by changing the snmpget binary path to a malicious script uploaded on the local filesystem and visiting the /about page.
A critical security flaw in LibreNMS allows authenticated administrators to execute arbitrary commands by modifying the configured binary path for snmpget and accessing the About page. This occurs due to insufficient verification of the executable file's identity and integrity prior to executing it with shell_exec.
LibreNMS is an open-source, PHP-based autodiscovering network monitoring tool that relies extensively on external system binaries to query network devices. The application exposes an administrative interface that allows authorized users to manage system configurations, including the file paths for utilities such as Net-SNMP. One of these utilities is the snmpget binary, which LibreNMS executes to retrieve SNMP data and verify version information.
Historically, configuration systems that execute system commands face substantial risks if input fields are not strictly restricted to pre-defined safe paths. In LibreNMS, the configuration settings are stored in a database and can be modified by users holding administrative privileges. The /about endpoint of the application triggers a configuration check that invokes the binary path defined in this database.
This architecture creates an attack surface where an administrative user can influence the execution path of system commands. If an attacker can manipulate the binary path configuration to point to an arbitrary executable, they can abuse the application logic to execute arbitrary code on the underlying operating system. The vulnerability is classified under command injection and path traversal weaknesses.
The root cause of this vulnerability lies in the insufficient validation of the snmpget configuration value within the AboutController.php file. When the /about endpoint is accessed, the application retrieves the path to the snmpget executable and runs it using the PHP shell_exec() function. This function passes the command string directly to the host shell for execution, which inherently exposes the system to command execution vulnerabilities if the binary path itself is untrusted.
To prevent malicious inputs, LibreNMS employs a sanitization filter named sanitizePath() located in LibreNMS/Util/DynamicConfigItem.php. This helper function utilizes a regular expression pattern to detect and reject typical shell metacharacters such as semicolons, pipes, backticks, and redirection operators. It also verifies that the configured target is a valid, executable file on the local disk using PHP's native is_file() and is_executable() functions.
While this sanitization effectively blocks direct inline command injection (such as appending a command separator followed by malicious code), it fails to validate the identity and integrity of the executable itself. An attacker who can write a file to the filesystem can specify their malicious script as the target executable. Because the malicious script exists as a valid file and has the executable bit set, it satisfies both is_file() and is_executable(), allowing the path to be saved and subsequently executed by the application.
The vulnerable version of the application processes the execution of the version check inside app/Http/Controllers/AboutController.php as follows:
// Vulnerable code in AboutController.php
'version_netsnmp' => str_replace('version: ', '',
rtrim(shell_exec(LibrenmsConfig::get('snmpget', 'snmpget') . ' -V 2>&1'))),In this implementation, shell_exec() is used to execute the binary string directly. This passes the command to the default shell (typically /bin/sh), which interprets the string and runs the target process.
To remediate this issue, the patch replaces shell_exec() with the Symfony Process component, which executes the binary directly without spawning a shell interpreter. The updated code inside the controller is structured as follows:
// Patched code in AboutController.php
use Symfony\Component\Process\Process;
// The process is initialized with arguments as an array
$process = new Process([LibrenmsConfig::get('snmpget', 'snmpget'), '-V']);
$process->run();
'version_netsnmp' => str_replace('version: ', '', rtrim($process->getOutput())),By passing the binary path and arguments as an array, the Symfony Process component bypasses shell parsing. Even if the path points to a customized script, it prevents any argument injection or command-chaining. This restricts the execution to the targeted file and safely processes the output.
Exploitation of this vulnerability requires administrative credentials to access the LibreNMS web interface and modify system settings. In addition, the attacker must have a mechanism to write or upload an executable script onto the local filesystem of the target server. Common avenues for dropping the script include using temporary directories like /tmp, leveraging existing file upload functionalities, or exploiting secondary vulnerabilities.
Once a malicious executable is written to the filesystem, the attacker modifies the snmpget binary path configuration. This can be accomplished by navigating to the 'Settings' panel under 'External Binaries' or by sending a direct PUT request to /settings/snmpget. The value is set to the absolute path of the newly written executable file, which passes the validation checks because it exists and is executable.
PUT /settings/snmpget HTTP/1.1
Host: librenms.target.local
Authorization: Bearer <ADMIN_API_TOKEN>
Content-Type: application/json
{
"value": "/tmp/malicious_script.sh"
}After saving the configuration, the attacker triggers the execution by requesting the /about endpoint. The server executes the malicious script via the web daemon's account. This allows the attacker to establish a reverse shell connection or execute arbitrary system commands, resulting in host compromise.
The security impact of successful exploitation is high, leading to arbitrary code execution within the context of the web server daemon (such as www-data or apache). An attacker can leverage this execution access to read sensitive configuration files, modify application data, or access the database credentials stored within the LibreNMS environment.
Because LibreNMS acts as a centralized network monitoring platform, it typically holds sensitive operational data. This data includes SNMP community strings, API keys, network topology maps, and credentials for monitored network infrastructure. Access to the LibreNMS host allows an attacker to pivot and conduct lateral movement across the entire monitored corporate network.
From a CVSS perspective, the vulnerability is scored at 6.4 (CVSS v4.0) under the assumption that the immediate impact to the application itself is managed, but subsequent impact to the host OS and connected systems is high. Under CVSS v3, this scenario represents a high-severity vulnerability with a score of 7.2 due to the administrative privilege requirement.
The primary remediation for this vulnerability is upgrading LibreNMS to version 26.5.0 or higher. This version implements safe process execution via the Symfony Process component, neutralizing the command injection vector. System administrators should verify that all binary paths point to standard system directories after the upgrade.
If immediate upgrading is not feasible, several defensive workarounds should be applied to reduce the attack surface. Administrators should mount temporary write directories, such as /tmp and /var/tmp, with the noexec mount option to prevent the execution of arbitrary scripts dropped by attackers.
# Example of setting noexec on /tmp dynamically
mount -o remount,noexec /tmpAdditionally, access to the administration interface must be restricted to trusted networks using firewall rules, reverse proxies, or Web Application Firewalls (WAFs). WAF rules can be deployed to block PUT requests to the /settings/snmpget endpoint from unauthorized source IPs, ensuring that only authenticated maintenance channels can modify critical configurations.
CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:H| Product | Affected Versions | Fixed Version |
|---|---|---|
LibreNMS librenms | < 26.5.0 | 26.5.0 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-77, CWE-78 |
| Attack Vector | Network |
| CVSS v3.x Score | 7.2 (High) |
| CVSS v4.0 Score | 6.4 (Medium) |
| Exploit Status | Proof-of-Concept (PoC) |
| KEV Status | Not Listed |
| Affected Component | AboutController.php |
| Patch Version | 26.5.0 |
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Netflix Lemur, a TLS/SSL certificate management framework, contains a missing authorization check in its certificate export endpoint. Prior to version 1.9.3, the validation logic verifying whether a user had permission to export a certificate was incorrectly placed inside a block that executed only if the selected plugin required a private key. When an authenticated user attempted to export a certificate using a plugin that did not require the private key, the authorization check was bypassed, allowing unauthorized access to the public portions of the certificate and producing misleading audit logs.
LibreNMS versions prior to 26.7.0 are vulnerable to a stored Cross-Site Scripting (XSS) vulnerability. An authenticated administrator can inject arbitrary HTML or JavaScript into graph descriptions via specific administrative configuration endpoints. When another authenticated user views the affected graph, the unescaped payload executes within their browser context.
An injection vulnerability in LibreNMS's Oxidized integration component allows administrative or network-positioned attackers to achieve stored cross-site scripting (XSS). By setting a malicious oxidized.url endpoint, the server makes outbound queries and processes returned JSON fields containing malicious HTML or JavaScript. These payloads are outputted directly in the web UI without appropriate output encoding.
CVE-2026-17106 (CopyEscape) is a container-to-host arbitrary file-write vulnerability within Docker's archiving and extraction library moby/go-archive. By utilizing a Time-of-Check to Time-of-Use (TOCTOU) race condition during the file-walking stage inside a running container, a malicious container process can force the host engine to produce a compromised tar stream. During client-side extraction, the Docker CLI resolves directory entries through absolute symbolic links, resulting in arbitrary file creation or modification on the host system.
CVE-2026-73974 is a local path traversal vulnerability in linuxfabrik-lib and Linuxfabrik Monitoring Plugins. Under standard monitoring configurations running with elevated privileges via sudo, this flaw can be exploited by an unprivileged local user to read arbitrary root-only files, resulting in local privilege escalation.
CVE-2026-71417 is an authorization bypass vulnerability (CWE-639) in Netflix Lemur, an open-source TLS certificate management framework. In versions prior to 1.9.3, a low-privileged authenticated user can bypass role and certificate-level permission boundaries to revoke arbitrary managed TLS certificates at the upstream Certificate Authority (CA). This vulnerability stems from an architectural issue where Lemur evaluates authorization against internal database row ownership rather than the unique, cryptographic identity of the certificate. An attacker can exploit this flaw by uploading a duplicate record of a target certificate and requesting its revocation, triggering a downstream CA-side revocation and a subsequent denial-of-service (DoS) condition for services relying on the target certificate.