CVE-2024-51092
LibreNMS has an Authenticated OS Command Injection
LibreNMS before 24.10.0 allows a remote attacker to execute arbitrary code via OS command injection involving AboutController.php's index(), SettingsController.php's update(), and PollDevice.php's initRrdDirectory().
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- Low
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- Low
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
9.1
LibreNMS before 24.10.0 allows a remote attacker to execute arbitrary code via OS command injection involving AboutController.php's index(), SettingsController.php's update(), and PollDevice.php's initRrdDirectory().
- Record
CVE-2024-51092- CVSS 3.1
- 9.1 Critical
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:L - Weakness
- CWE-78
- Updated
- 2026-11-02
EUVDEUVD-2024-55572
9.1
LibreNMS before 24.10.0 allows a remote attacker to execute arbitrary code via OS command injection involving AboutController.php's index(), SettingsController.php's update(), and PollDevice.php's initRrdDirectory().
- Record
EUVD-2024-55572- CVSS 3.1
- 9.1 Critical
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:L - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-x645-6pf9-xwxw
9.1
LibreNMS has an Authenticated OS Command Injection
Summary
An authenticated attacker can create dangerous directory names on the system and alter sensitive configuration parameters through the web portal. Those two defects combined then allows to inject arbitrary OS commands inside shell_exec() calls, thus achieving arbitrary code execution.
Details
OS Command Injection
We start by inspecting the file app/Http/Controllers/AboutController.php, more particularly the index() method which is executed upon simply visiting the /about page:
public function index(Request $request)
{
$version = Version::get();
return view('about.index', [
<TRUNCATED>
'version_webserver' => $request->server('SERVER_SOFTWARE'),
'version_rrdtool' => Rrd::version(),
'version_netsnmp' => str_replace('version: ', '', rtrim(shell_exec(Config::get('snmpget', 'snmpget') . ' -V 2>&1'))),
<TRUNCATED>
]);
}
We can see that the version_netsnmp key receives a value direclty dependent of a shell_exec() call. The argument to this call reflects a configuration parameter with no sanitization. Should an attacker identify a way to alter this parameter, the server is at risk of being compromised.
Configuration parameters poisoning
We now focus on the update() method of the SettingsController.php script. This method is called when the user visits the route /settings/{key} via HTTP PUT. The key parameter here is simply the name of the configuration key the user wishes to modify.
public function update(DynamicConfig $config, Request $request, $id)
{
$value = $request->get('value');
if (! $config->isValidSetting($id)) {
return $this->jsonResponse($id, ':id is not a valid setting', null, 400);
}
$current = \LibreNMS\Config::get($id);
$config_item = $config->get($id);
if (! $config_item->checkValue($value)) {
return $this->jsonResponse($id, $config_item->getValidationMessage($value), $current, 400);
}
if (\LibreNMS\Config::persist($id, $value)) {
return $this->jsonResponse($id, "Successfully set $id", $value);
}
return $this->jsonResponse($id, 'Failed to update :id', $current, 400);
}
We can see that some protections are implemented around the configuration parameters by $config_item->checkValue($value), with a format of data being expected depending on the data type of the variable the user wants to modify.
Specifically, the snmpget configuration variable expects a valid path to an existing binary on the system.
To summarize : if an attacker finds a valid full-path to a system binary, while that full-path also holds shell metacharacters, then those characters would be interpreted by the shell_exec() call defined above and allow for arbitrary command execution.
Arbitrary directory creation
When creating a new Device through the "Add Device" page, the server allows the user to send malformed or impossible hostnames and force the data to be stored, with no sanitization being performed on this field.
In the file app/Jobs/PollDevice.php, the initRrdDirectory() method is responsible for creating a directory named after the Device's hostname. We can see the mkdir() call inside the try block:
private function initRrdDirectory(): void
{
$host_rrd = \Rrd::name($this->device->hostname, '', '');
if (Config::get('rrd.enable', true) && ! is_dir($host_rrd)) {
try {
mkdir($host_rrd);
Log::info("Created directory : $host_rrd");
} catch (\ErrorException $e) {
Eventlog::log("Failed to create rrd directory: $host_rrd", $this->device);
Log::info($e);
}
}
}
This method is called by initDevice(), which is itself called by the handle() method (executed when the job starts).
\Rrd::name() simply concatenates a string following the format <LIBRENMS_INSTALL_DIR>/rrd/<DEVICE_HOSTNAME>.
Summary
With all this, an…
- Record
GHSA-x645-6pf9-xwxw- CVSS 3.1
- 9.1 Critical
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:L - Weakness
- CWE-78
- Updated
- 2026-11-02
NVD
9.1
LibreNMS before 24.10.0 allows a remote attacker to execute arbitrary code via OS command injection involving AboutController.php's index(), SettingsController.php's update(), and PollDevice.php's initRrdDirectory().
- Record
CVE-2024-51092- CVSS 3.1
- 9.1 Critical
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:L - Weakness
- CWE-78
- Updated
- 2026-11-02
OSV
9.1
LibreNMS before 24.10.0 allows a remote attacker to execute arbitrary code via OS command injection involving AboutController.php's index(), SettingsController.php's update(), and PollDevice.php's initRrdDirectory().
- Record
CVE-2024-51092- CVSS 3.1
- 9.1 Critical
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:L - Updated
- 2026-11-02
OSVGHSA-x645-6pf9-xwxw
9.1
LibreNMS has an Authenticated OS Command Injection
Summary
An authenticated attacker can create dangerous directory names on the system and alter sensitive configuration parameters through the web portal. Those two defects combined then allows to inject arbitrary OS commands inside shell_exec() calls, thus achieving arbitrary code execution.
Details
OS Command Injection
We start by inspecting the file app/Http/Controllers/AboutController.php, more particularly the index() method which is executed upon simply visiting the /about page:
public function index(Request $request)
{
$version = Version::get();
return view('about.index', [
<TRUNCATED>
'version_webserver' => $request->server('SERVER_SOFTWARE'),
'version_rrdtool' => Rrd::version(),
'version_netsnmp' => str_replace('version: ', '', rtrim(shell_exec(Config::get('snmpget', 'snmpget') . ' -V 2>&1'))),
<TRUNCATED>
]);
}
We can see that the version_netsnmp key receives a value direclty dependent of a shell_exec() call. The argument to this call reflects a configuration parameter with no sanitization. Should an attacker identify a way to alter this parameter, the server is at risk of being compromised.
Configuration parameters poisoning
We now focus on the update() method of the SettingsController.php script. This method is called when the user visits the route /settings/{key} via HTTP PUT. The key parameter here is simply the name of the configuration key the user wishes to modify.
public function update(DynamicConfig $config, Request $request, $id)
{
$value = $request->get('value');
if (! $config->isValidSetting($id)) {
return $this->jsonResponse($id, ':id is not a valid setting', null, 400);
}
$current = \LibreNMS\Config::get($id);
$config_item = $config->get($id);
if (! $config_item->checkValue($value)) {
return $this->jsonResponse($id, $config_item->getValidationMessage($value), $current, 400);
}
if (\LibreNMS\Config::persist($id, $value)) {
return $this->jsonResponse($id, "Successfully set $id", $value);
}
return $this->jsonResponse($id, 'Failed to update :id', $current, 400);
}
We can see that some protections are implemented around the configuration parameters by $config_item->checkValue($value), with a format of data being expected depending on the data type of the variable the user wants to modify.
Specifically, the snmpget configuration variable expects a valid path to an existing binary on the system.
To summarize : if an attacker finds a valid full-path to a system binary, while that full-path also holds shell metacharacters, then those characters would be interpreted by the shell_exec() call defined above and allow for arbitrary command execution.
Arbitrary directory creation
When creating a new Device through the "Add Device" page, the server allows the user to send malformed or impossible hostnames and force the data to be stored, with no sanitization being performed on this field.
In the file app/Jobs/PollDevice.php, the initRrdDirectory() method is responsible for creating a directory named after the Device's hostname. We can see the mkdir() call inside the try block:
private function initRrdDirectory(): void
{
$host_rrd = \Rrd::name($this->device->hostname, '', '');
if (Config::get('rrd.enable', true) && ! is_dir($host_rrd)) {
try {
mkdir($host_rrd);
Log::info("Created directory : $host_rrd");
} catch (\ErrorException $e) {
Eventlog::log("Failed to create rrd directory: $host_rrd", $this->device);
Log::info($e);
}
}
}
This method is called by initDevice(), which is itself called by the handle() method (executed when the job starts).
\Rrd::name() simply concatenates a string following the format <LIBRENMS_INSTALL_DIR>/rrd/<DEVICE_HOSTNAME>.
Summary
With all this, an…
- Record
GHSA-x645-6pf9-xwxw- CVSS 3.1
- 9.1 Critical
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:L - Weakness
- CWE-78
- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
librenms/librenmsPackagist |
through 24.9.1 | 24.10.0 |
librenms/librenmsPackagist |
before 24.10.0, plus listed versions 1.191.201.20.11.211.22 Show 45 moreShow less1.22.011.231.241.251.261.271.281.291.301.30.011.311.31.011.31.021.31.031.321.32.011.331.33.011.341.351.361.36.011.371.381.391.401.411.421.42.011.431.441.451.461.471.481.48.11.491.501.50.11.511.521.531.53.11.541.55 |
24.10.0 |
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| Metasploit | LibreNMS Authenticated RCE (CVE-2024-51092) | 2024-11-15 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, Metasploit, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2024-51092 is a critical vulnerability (CVSS 9.1) in Librenms, published November 15, 2024. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 7.18%, the 94th percentile. Fixed in librenms/librenms 24.10.0.
References
raw.githubusercontent.com/rapid7/metasploit-framework/master/modules/exploits/linux/http/librenms_authenticated_rce_cve_2024_51092.rb
github.com/librenms/librenms/security/advisories/GHSA-x645-6pf9-xwxw
nvd.nist.gov/vuln/detail/CVE-2024-51092
github.com/advisories/GHSA-x645-6pf9-xwxw
github.com/CVEProject/cvelistV5/tree/main/cves/2024/51xxx/CVE-2024-51092.json
github.com/librenms/librenms
Left out here: 80 versions and the rest of 2 source descriptions. The JSON record has them.