CVE-2024-50351: Reflected XSS Vulnerability in LibreNMS
Summary
CVE-2024-50351: LibreNMS has a Reflected XSS ('Cross-site Scripting') in librenms/includes/functions.php. Affects librenms/librenms versions < 24.10.0. Fixed in 24.10.0. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
LibreNMS is an open-source network monitoring tool that provides a robust platform for managing and monitoring network devices. It features automatic discovery, alerting, and a user-friendly web interface. However, it is susceptible to security vulnerabilities, including reflected cross-site scripting (XSS), which can compromise user sessions and allow unauthorized actions.
Vulnerability Detail
A reflected XSS vulnerability exists in the 'section' parameter of the 'logs' tab within LibreNMS. This flaw allows attackers to inject arbitrary JavaScript code through a crafted URL. The vulnerability arises from insufficient sanitization in the 'report_this()' function, leading to potential session hijacking and unauthorized actions when a user accesses the malicious URL. The affected code can be found in functions.php and logs.inc.php files of the LibreNMS repository.
How To Fix
Minimum fixed version
24.10.0
This is the first release that contains the fix.
composer require librenms/librenms:24.10.0
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary measure, users can avoid clicking on untrusted links that include the 'section' parameter in the logs tab. Additionally, implementing Content Security Policy (CSP) headers can help mitigate the risk of XSS attacks.
Conclusion
The reflected XSS vulnerability in LibreNMS poses significant risks to users by allowing attackers to execute arbitrary JavaScript. It is crucial to update to the latest version to mitigate these risks. Utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.
See every vulnerability recorded for librenms/librenms →
FAQ
Reflected XSS is a type of cross-site scripting attack where malicious scripts are reflected off a web server and executed in the user's browser, often through crafted URLs.
You can check if your installation is affected by using Vulert, which monitors open-source vulnerabilities in real-time. Visit Vulert Scanner to test your application without needing to sign up.
The vulnerability can lead to session hijacking, unauthorized actions on behalf of the user, and further exploitation through malicious scripts.
Yes, implementing Content Security Policy (CSP) headers and ensuring proper input sanitization can help protect against XSS attacks.
If an immediate update is not possible, avoid using the affected features and consider implementing temporary security measures like CSP headers.
References
Related vulnerabilities
Recent vulnerabilities recorded for librenms/librenms.