CVE-2024-47528: Librenms/librenms Cross-Site Scripting Vulnerability

LOW
Advisory Identifier: GHSA-x8gm-j36p-fppf
CVSS 4.8
CWE-116 CWE-434 CWE-79
Published
Advisory Summary

CVE-2024-47528 is a LOW (CVSS 4.8) cross-site scripting vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting Librenms/librenms libraries in the Packagist ecosystem. The issue involves librenms vulnerable to stored cross-site scripting via file upload. Remediation is available by upgrading affected packages to version 24.9.0.

CVE-2024-47528 at a Glance

CVE Identifier CVE-2024-47528
GHSA Identifier GHSA-x8gm-j36p-fppf
Severity LOW
CVSS v3.1 Base Score 4.8
CWE Classification CWE-116: Improper Encoding or Escaping of Output
Affected Product Librenms/librenms
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 4.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2024-47528

To remediate this vulnerability, upgrade all affected Librenms/librenms dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

librenms/librenms fixed: 24.9.0
Upgrade librenms/librenms to 24.9.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for librenms/librenms

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-47528, inspect your project dependencies for Librenms/librenms:

inspect dependencies for librenms/librenms

Analyze the terminal output to locate any version of Librenms/librenms in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 24.9.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-116: Improper Encoding or Escaping of Output, where the product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. as a result, the intended structure of the message is not preserved. In Librenms/librenms, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary Stored Cross-Site Scripting (XSS) can archive via Uploading a new Background for a Custom Map. ### Details Users with "admin" role can set background for a custom map, this allow the upload of SVG file that can contain XSS payload which will trigger onload. This led to Stored Cross-Site Scripting (XSS). ### PoC 1. Login using an Admin role account. 2. Go over to "$URL/maps/custom", the Manage Custom Maps. ![image](https://github.com/user-attachments/assets/9d621532-7880-4010-b12d-efd377f0cfdd) 3. Create a new map then choose to edit it. 4. Choose the "Set Background" option. ![image](https://github.com/user-attachments/assets/dc2e9453-ef3e-4649-a42f-60b7a2ad8189) 5. Choose to upload a SVG file that have this content. ```svg <svg xmlns="http://www.w3.org/2000/svg" onload="alert(document.domain)"> <circle cx="50" cy="50" r="40" /> </svg> ``` 6. Once uploaded, there should be a link to the SVG return in the POST request to the API "$URL/maps/custom/1/background". ![image](https://github.com/user-attachments/assets/dc224960-0bd3-42c9-ad49-2ec85b065939) 7. Go over to that link on browser, should see a pop-up. ![image](https://github.com/user-attachments/assets/47a7db14-bd89-48fe-885a-fd80a052115e) ### Impact Attacker can use this to perform malicious java script code for malicious intent. This would impact other Admin role users and the Global Read role users. Normal users does not have permission to read the file, so they are not affected.

CVE-2024-47528 Affected Librenms/librenms Versions

1 component(s)
Fixed Versions:
24.9.0
Product / Package Ecosystem Affected Versions Fixed Version
librenms/librenms
Packagist
< 24.9.0
24.9.0

References

Frequently Asked Questions

What is CVE-2024-47528?
CVE-2024-47528 is a security vulnerability in Librenms/librenms involving LibreNMS vulnerable to Stored Cross-site Scripting via File Upload under CWE-116: Improper Encoding or Escaping of Output.
Which Librenms/librenms versions are affected?
Affected versions include releases prior to 24.9.0 across affected packages: librenms/librenms.
What version fixes CVE-2024-47528?
Upgrading to 24.9.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is librenms/librenms affected?
Yes, librenms/librenms is affected in releases prior to 24.9.0. Upgrade your dependency to 24.9.0 or later.
What is the CVSS score of CVE-2024-47528?
CVE-2024-47528 has a CVSS v3.1 base score of 4.8 (LOW) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2024-47528?
CVE-2024-47528 is classified under CWE-116: Improper Encoding or Escaping of Output (The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.).
How can I check Packagist dependencies for CVE-2024-47528?
Run the dependency tree command: 'inspect dependencies for librenms/librenms'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-x8gm-j36p-fppf",
  "modified" : "2024-12-19T20:14:29Z",
  "published" : "2024-10-01T22:27:32Z",
  "aliases" : [ "CVE-2024-47528" ],
  "summary" : "LibreNMS vulnerable to Stored Cross-site Scripting via File Upload",
  "details" : "### Summary\nStored Cross-Site Scripting (XSS) can archive via Uploading a new Background for a Custom Map.\n\n### Details\nUsers with \"admin\" role can set background for a custom map, this allow the upload of SVG file that can contain XSS payload which will trigger onload. This led to Stored Cross-Site Scripting (XSS).\n\n### PoC\n1. Login using an Admin role account.\n\n2. Go over to \"$URL/maps/custom\", the Manage Custom Maps.\n![image](https://github.com/user-attachments/assets/9d621532-7880-4010-b12d-efd377f0cfdd)\n\n3. Create a new map then choose to edit it.\n4. Choose the \"Set Background\" option.\n![image](https://github.com/user-attachments/assets/dc2e9453-ef3e-4649-a42f-60b7a2ad8189)\n\n5. Choose to upload a SVG file that have this content.\n```svg\n<svg xmlns=\"http://www.w3.org/2000/svg\" onload=\"alert(document.domain)\">\n  <circle cx=\"50\" cy=\"50\" r=\"40\" />\n</svg>\n```\n\n6. Once uploaded, there should be a link to the SVG return in the POST request to the API \"$URL/maps/custom/1/background\".\n![image](https://github.com/user-attachments/assets/dc224960-0bd3-42c9-ad49-2ec85b065939)\n\n7. Go over to that link on browser, should see a pop-up.\n![image](https://github.com/user-attachments/assets/47a7db14-bd89-48fe-885a-fd80a052115e)\n\n### Impact\nAttacker can use this to perform malicious java script code for malicious intent.\nThis would impact other Admin role users and the Global Read role users. Normal users does not have permission to read the file, so they are not affected.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "librenms/librenms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "24.9.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/librenms/librenms/security/advisories/GHSA-x8gm-j36p-fppf"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-47528"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/librenms/librenms/commit/d959bf1b366319eda16e3cd6dfda8a22beb203be"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/librenms/librenms"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-116", "CWE-434", "CWE-79" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-10-01T22:27:32Z",
    "nvd_published_at" : "2024-10-01T21:15:08Z"
  }
}