CVE-2024-47526 — Vulnerability in librenms/librenms — CVE Details
LibreNMS has Stored Cross-site Scripting vulnerability in "Alert Templates" feature
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.71%). 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-47526 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 Self Cross-Site Scripting (Self-XSS) vulnerability in the "Alert Templates" feature allows users to inject arbitrary JavaScript into the alert template's name. This script executes immediately upon submission but does not persist after a page refresh.
Details
The vulnerability occurs when creating an alert template in the LibreNMS interface. Although the application sanitizes the "name" field when storing it in the database, this newly created template is immediately added to the table without any sanitization being applied to the name, allowing users to inject arbitrary JavaScript. This script executes when the template is created but does not persist in the database, thus preventing stored XSS.
For instance, the following payload can be used to exploit the vulnerability:
test1<script>{onerror=alert}throw 1337</script>
The root cause of this vulnerability lies in the lack of sanitization of the "name" variable before it is rendered in the table. The vulnerability exists because the bootgrid function of the jQuery grid plugin does not sanitize the text being added to the table. Although tags are stripped before being added to the database (as shown in the code below), the vulnerability still allows Self-XSS during the creation of the template.
Where the variable is being sanitized before being stored in the database: https://github.com/librenms/librenms/blob/0e741e365aa974a74aee6b43d1b4b759158a5c7e/includes/html/forms/alert-templates.inc.php#L40
Where the vulnerability is happening: https://github.com/librenms/librenms/blob/0e741e365aa974a74aee6b43d1b4b759158a5c7e/includes/html/modal/alert_template.inc.php#L205
PoC
- Navigate to the "Alert Templates" creation page in the LibreNMS interface.
- In the "Name" field, input the following payload:
test1<script>{onerror=alert}throw 1337</script> - Submit the form to create the alert template.
- Observe that the JavaScript executes immediately, triggering an alert popup. However, this code does not persist after refreshing the page.
Impact
This is a Self Cross-Site Scripting (Self-XSS) vulnerability. Although the risk is lower compared to traditional XSS, it can still be exploited through social engineering or tricking users into entering or interacting with malicious code. This can lead to unauthorized actions or data exposure in the context of the affected user's session.
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) 3.5 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:L/I:L/A:N
References
- https://github.com/librenms/librenms/security/advisories/GHSA-gcgp-q2jq-fw52WEB
- https://nvd.nist.gov/vuln/detail/CVE-2024-47526ADVISORY
- https://github.com/librenms/librenms/commit/f259edc19b9f0ccca484c60b1ba70a0bfff97ef5WEB
- https://github.com/librenms/librenmsPACKAGE
- https://github.com/librenms/librenms/blob/0e741e365aa974a74aee6b43d1b4b759158a5c7e/includes/html/forms/alert-templates.inc.php#L40WEB
- https://github.com/librenms/librenms/blob/0e741e365aa974a74aee6b43d1b4b759158a5c7e/includes/html/modal/alert_template.inc.php#L205WEB
Frequently Asked Questions
- What is CVE-2024-47526?
- LibreNMS has Stored Cross-site Scripting vulnerability in "Alert Templates" feature. This vulnerability has been assigned a severity rating of LOW (CVSS score: 3.5/10).
- How do I check if my project is affected by CVE-2024-47526?
- CVE-2024-47526 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-47526 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation is difficult, or the impact is minor.
This is a below-median EPSS score — only 49.3% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2026-55182HIGH
LibreNMS Vulnerable to Remote Code Execution by Signal Alert Transportation module
- CVE-2024-32461HIGH
LibreNMS vulnerable to SQL injection time-based leads to database extraction
- CVE-2024-47524HIGH
LibreNMS has Stored Cross-site Scripting vulnerability in "Device Group" Name
- CVE-2024-49754HIGH
LibreNMS has a stored XSS ('Cross-site Scripting') in librenms/includes/html/pages/api-access.inc.php
- CVE-2025-54138HIGH
LibreNMS has Authenticated Remote File Inclusion in ajax_form.php that Allows RCE
- CVE-2025-62411MEDIUM
LibreNMS has a Stored XSS vulnerability in its Alert Transport name field
- CVE-2025-23201MEDIUM
Librenms has a reflected XSS on error alert
- CVE-2026-26987MEDIUM
LibreNMS affected by reflected xss via email field