Skip to main content

CVE-2024-47526 — Vulnerability in librenms/librenms — CVE Details

LOW

LibreNMS has Stored Cross-site Scripting vulnerability in "Alert Templates" feature

Published October 1, 2024Updated October 1, 2024Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.71%). Schedule for your next planned update.

Does your project use an affected librenms/librenms version?

Paste your composer.lock to check it for CVE-2024-47526 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my composer.lock

Summary

Summary

A Self Cross-Site Scripting (Self-XSS) vulnerability in the "Alert Templates" feature 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.

Details

The vulnerability occurs when creating an alert template in the LibreNMS interface. Although the application sanitizes the "name" field when storing it in the database, this newly created template is immediately added to the table without any sanitization being applied to the name, allowing users to inject arbitrary JavaScript. This script executes when the template is created but does not persist in the database, thus preventing stored XSS.

For instance, the following payload can be used to exploit the vulnerability: test1<script>{onerror=alert}throw 1337</script>

The root cause of this vulnerability lies in the lack of sanitization of the "name" variable before it is rendered in the table. The vulnerability exists because the bootgrid function of the jQuery grid plugin does not sanitize the text being added to the table. Although tags are stripped before being added to the database (as shown in the code below), the vulnerability still allows Self-XSS during the creation of the template.

Where the variable is being sanitized before being stored in the database: https://github.com/librenms/librenms/blob/0e741e365aa974a74aee6b43d1b4b759158a5c7e/includes/html/forms/alert-templates.inc.php#L40

Where the vulnerability is happening: https://github.com/librenms/librenms/blob/0e741e365aa974a74aee6b43d1b4b759158a5c7e/includes/html/modal/alert_template.inc.php#L205

PoC

  1. Navigate to the "Alert Templates" creation page in the LibreNMS interface.
  2. In the "Name" field, input the following payload: 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 popup. However, this code does not persist after refreshing the page.

Impact

This is a Self Cross-Site Scripting (Self-XSS) vulnerability. Although the risk is lower compared to traditional XSS, it can still be exploited through social engineering or tricking users into entering or interacting with malicious code. This can lead to unauthorized actions or data exposure in the context of the affected user's session.

Advisory Timeline

  • First published October 1, 2024 (786 days ago).
  • Last revised October 1, 2024 — 0 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Composer
Update librenms/librenms to 24.9.0 or later
composer require "librenms/librenms:^24.9.0"

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: Packagist (1).

PackageFixed In
librenms/librenms Packagist · Affected: 1.19, 1.20, 1.20.1, 1.21 (+124 more)24.9.0

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-79
    Cross-site Scripting (XSS)MITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 3.5 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
High
User Interaction
Required
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None

CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:L/I:L/A:N

Frequently Asked Questions

What is CVE-2024-47526?
LibreNMS has Stored Cross-site Scripting vulnerability in "Alert Templates" feature. This vulnerability has been assigned a severity rating of LOW (CVSS score: 3.5/10).
How do I check if my project is affected by CVE-2024-47526?
CVE-2024-47526 affects librenms/librenms. It has a 0.7% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2024-47526 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
3.5

Exploitation is difficult, or the impact is minor.

EPSS Score (30-day exploit probability)
0.71%
EPSS percentile: 49.3

This is a below-median EPSS score — only 49.3% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.

Also Known As

GHSA-gcgp-q2jq-fw52

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my composer.lock