CVE-2024-50351 — Vulnerability in librenms/librenms — CVE Details
LibreNMS has a Reflected XSS ('Cross-site Scripting') in librenms/includes/functions.php
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.60%). 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-50351 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 Reflected Cross-Site Scripting (XSS) vulnerability in the "section" parameter of the "logs" tab of a device allows attackers to inject arbitrary JavaScript. This vulnerability results in the execution of malicious code when a user accesses the page with a malicious "section" parameter, potentially compromising their session and enabling unauthorized actions. The issue arises from a lack of sanitization in the "report_this()" function.
Details
The "section" parameter of the "logs" tab is vulnerable to reflected XSS. An attacker can inject the following XSS payload into the "section" parameter:
<script>constructor['constructor'](atob('Y29uZmlybShkb2N1bWVudC5kb21haW4p'))();<%2fscript>
When the page is loaded with this malicious parameter, the script executes immediately. This vulnerability occurs due to the lack of sanitization in the "report_this()" function. Other endpoints using this same function may also be vulnerable.
The vulnerable sink is located here: https://github.com/librenms/librenms/blob/7f2ae971c4a565b0d7345fa78b4211409f96800a/includes/functions.php#L523 https://github.com/librenms/librenms/blob/7f2ae971c4a565b0d7345fa78b4211409f96800a/includes/html/pages/device/logs.inc.php#L93
PoC
- Inject the following payload into the "section" parameter of the "logs" tab:
<script>constructor['constructor'](atob('Y29uZmlybShkb2N1bWVudC5kb21haW4p'))();<%2fscript> - Access the page with the injected payload.
- Observe that the injected script executes when the page is loaded.
Example URL: http://<your_url>/device/device=1/tab=logs/section=%3Cscript%3Econstructor['constructor'](atob('Y29uZmlybShkb2N1bWVudC5kb21haW4p'))();%3C%2fscript%3E/
Example Request:
GET /device/device=1/tab=logs/section=%3Cscript%3Econstructor['constructor'](atob('Y29uZmlybShkb2N1bWVudC5kb21haW4p'))();%3C%2fscript%3E/ HTTP/1.1
Host: <your_host>
Cookie: <your_cookie>
Impact
This vulnerability allows attackers to execute arbitrary JavaScript in the context of a user’s session by crafting a malicious URL. The attack could lead to session hijacking, unauthorized actions, or further exploitation by injecting malicious scripts.
Advisory Timeline
- First published November 15, 2024 (741 days ago).
- Last revised November 15, 2024 — 0 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
composer require "librenms/librenms:^24.10.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 (+126 more) | 24.10.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
Frequently Asked Questions
- What is CVE-2024-50351?
- LibreNMS has a Reflected XSS ('Cross-site Scripting') in librenms/includes/functions.php. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
- How do I check if my project is affected by CVE-2024-50351?
- CVE-2024-50351 affects librenms/librenms. It has a 0.6% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2024-50351 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is a below-median EPSS score — only 43% 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-2024-32479HIGH
LibreNMS uses Improper Sanitization on Service template name leads to Stored XSS
- CVE-2024-51494HIGH
LibreNMS has a Stored XSS ('Cross-site Scripting') in librenms/app/Http/Controllers/Table/EditPortsController.php
- CVE-2026-26990HIGH
LibreNMS has a Time-Based Blind SQL Injection in address-search.inc.php
- CVE-2026-6204HIGH
LibreNMS is Vulnerable to Remote Code Execution by Arbitrary File Write
- CVE-2024-50352HIGH
LibreNMS has a Stored XSS ('Cross-site Scripting') in librenms/includes/html/pages/device/overview/services.inc.php
- CVE-2024-49764HIGH
LibreNMS has a Stored XSS ('Cross-site Scripting') in librenms/includes/html/pages/device/capture.inc.php
- CVE-2026-84188MEDIUM
LibreNMS: Stored XSS via graph_descr admin config settings echoed without escaping to all authenticated users
- CVE-2024-47527MEDIUM
LibreNMS has Stored Cross-site Scripting vulnerability in "Device Dependencies" feature