GHSA-28P7-F6H6-3JH3
Vulnerability from github – Published: 2024-11-15 15:45 – Updated: 2024-11-15 20:50Summary
A Reflected Cross-Site Scripting (XSS) vulnerability in the "metric" parameter of the "/wireless" and "/health" endpoints allows attackers to inject arbitrary JavaScript. This vulnerability results in the execution of malicious code when a user accesses the page with a malicious "metric" parameter, potentially compromising their session and allowing unauthorized actions.
Details
The "/wireless" and "/health" endpoints are vulnerable to reflected XSS in the "metric" parameter. An attacker can inject the following XSS payload into the "metric" parameter:
<script>constructor['constructor'](atob('Y29uZmlybShkb2N1bWVudC5kb21haW4p'))();<!---->
When the page is loaded with this malicious parameter, the script executes immediately. The vulnerability occurs due to improper sanitization of the "metric" parameter in the following sinks: https://github.com/librenms/librenms/blob/7f2ae971c4a565b0d7345fa78b4211409f96800a/includes/html/pages/wireless.inc.php#L82 https://github.com/librenms/librenms/blob/7f2ae971c4a565b0d7345fa78b4211409f96800a/includes/html/pages/health.inc.php#L114
PoC
- Inject the following payload into the "metric" parameter of the "/wireless" or "/health" endpoint:
<script>constructor['constructor'](atob('Y29uZmlybShkb2N1bWVudC5kb21haW4p'))();<!----> - Access the page with the injected payload.
- Observe that the injected script executes upon loading the page.
Example URL: http://<your_url>/wireless/metric=%3Cscript%3Econstructor['constructor'](atob('Y29uZmlybShkb2N1bWVudC5kb21haW4p'))();%3C!----%3E
Example Request:
GET /wireless/metric=%3Cscript%3Econstructor[%27constructor%27](atob(%27Y29uZmlybShkb2N1bWVudC5kb21haW4p%27))();%3C!----%3E HTTP/1.1
Host: <your_host>
Cookie: <your cookies>
Impact
This vulnerability allows attackers to execute arbitrary JavaScript in the context of a user’s session by crafting a malicious URL. The attack could lead to session hijacking, unauthorized actions, or further exploitation by injecting malicious scripts.
{
"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-51496"
],
"database_specific": {
"cwe_ids": [
"CWE-79"
],
"github_reviewed": true,
"github_reviewed_at": "2024-11-15T15:45:31Z",
"nvd_published_at": "2024-11-15T16:15:37Z",
"severity": "HIGH"
},
"details": "### Summary\nA Reflected Cross-Site Scripting (XSS) vulnerability in the \"metric\" parameter of the \"/wireless\" and \"/health\" endpoints allows attackers to inject arbitrary JavaScript. This vulnerability results in the execution of malicious code when a user accesses the page with a malicious \"metric\" parameter, potentially compromising their session and allowing unauthorized actions.\n\n### Details\nThe \"/wireless\" and \"/health\" endpoints are vulnerable to reflected XSS in the \"metric\" parameter. An attacker can inject the following XSS payload into the \"metric\" parameter:\n```\u003cscript\u003econstructor[\u0027constructor\u0027](atob(\u0027Y29uZmlybShkb2N1bWVudC5kb21haW4p\u0027))();\u003c!----\u003e```\n\nWhen the page is loaded with this malicious parameter, the script executes immediately. The vulnerability occurs due to improper sanitization of the \"metric\" parameter in the following sinks:\nhttps://github.com/librenms/librenms/blob/7f2ae971c4a565b0d7345fa78b4211409f96800a/includes/html/pages/wireless.inc.php#L82\nhttps://github.com/librenms/librenms/blob/7f2ae971c4a565b0d7345fa78b4211409f96800a/includes/html/pages/health.inc.php#L114\n\n### PoC\n1. Inject the following payload into the \"metric\" parameter of the \"/wireless\" or \"/health\" endpoint:\n```\u003cscript\u003econstructor[\u0027constructor\u0027](atob(\u0027Y29uZmlybShkb2N1bWVudC5kb21haW4p\u0027))();\u003c!----\u003e```\n2. Access the page with the injected payload.\n3. Observe that the injected script executes upon loading the page.\n\nExample URL: ```http://\u003cyour_url\u003e/wireless/metric=%3Cscript%3Econstructor[\u0027constructor\u0027](atob(\u0027Y29uZmlybShkb2N1bWVudC5kb21haW4p\u0027))();%3C!----%3E```\n\nExample Request:\n```http\nGET /wireless/metric=%3Cscript%3Econstructor[%27constructor%27](atob(%27Y29uZmlybShkb2N1bWVudC5kb21haW4p%27))();%3C!----%3E HTTP/1.1\nHost: \u003cyour_host\u003e\nCookie: \u003cyour cookies\u003e\n```\n\n### Impact\n\nThis vulnerability allows attackers to execute arbitrary JavaScript in the context of a user\u2019s session by crafting a malicious URL. The attack could lead to session hijacking, unauthorized actions, or further exploitation by injecting malicious scripts.\n",
"id": "GHSA-28p7-f6h6-3jh3",
"modified": "2024-11-15T20:50:19Z",
"published": "2024-11-15T15:45:31Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/librenms/librenms/security/advisories/GHSA-28p7-f6h6-3jh3"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-51496"
},
{
"type": "WEB",
"url": "https://github.com/librenms/librenms/commit/aef739a438ffb507e927a4ec87b359164a7a053a"
},
{
"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 Reflected XSS (\u0027Cross-site Scripting\u0027) in librenms/includes/html/pages/wireless.inc.php"
}
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.