Disclosed vulnerabilities
Fixed: Sep 29, 2024
CVE-2024-47526 Published: Oct 1, 2024

Stored Cross-site Scripting in @LibreNMS/LibreNMS Alert Templates

3.5 Low Severity librenms Self-XSS XSS
Raphael Silva Reported by Checkmarx Zero

Summary

A Self Cross-Site Scripting (Self-XSS) vulnerability in the “Alert Templates” feature of the @LibreNMS/LibreNMS project allows users to inject arbitrary JavaScript into the alert template’s name. This script executes immediately upon submission but does not persist after a page refresh.

Product

This vulnerability affects LibreNMS versions prior to 24.9.0, specifically in librenms/includes/html/modal/alert_template.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 and navigate to Alert Templates.
  2. In the Name field, enter: test1<script>{onerror=alert}throw 1337</script>
  3. Submit the form to create the alert template.
  4. Observe that the JavaScript executes immediately, triggering an alert. Note that the payload does not persist after refreshing the page.

Expected result:

The XSS is triggered, and an alert is shown.

Remediation

Fixed in LibreNMS 24.9.0 by HTML-encoding the template name before rendering. In modal/alert_template.inc.php, the name variable is now escaped before appending to the table, preventing XSS.

Credit

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

Resources

  1. GHSA-gcgp-q2jq-fw52
  2. Fix commit
  3. NVD entry for CVE-2024-47526

Stay connected and never miss a research update!