{"id":"CVE-2024-51496","aliases":["GHSA-28p7-f6h6-3jh3"],"url":"https://o3.security/vulnerability/CVE-2024-51496","summary":"LibreNMS has a Reflected XSS ('Cross-site Scripting') in librenms/includes/html/pages/wireless.inc.php","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```<script>constructor['constructor'](atob('Y29uZmlybShkb2N1bWVudC5kb21haW4p'))();<!---->```\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```<script>constructor['constructor'](atob('Y29uZmlybShkb2N1bWVudC5kb21haW4p'))();<!---->```\n2. Access the page with the injected payload.\n3. Observe that the injected script executes upon loading the page.\n\nExample URL: ```http://<your_url>/wireless/metric=%3Cscript%3Econstructor['constructor'](atob('Y29uZmlybShkb2N1bWVudC5kb21haW4p'))();%3C!----%3E```\n\nExample Request:\n```http\nGET /wireless/metric=%3Cscript%3Econstructor[%27constructor%27](atob(%27Y29uZmlybShkb2N1bWVudC5kb21haW4p%27))();%3C!----%3E HTTP/1.1\nHost: <your_host>\nCookie: <your cookies>\n```\n\n### Impact\n\nThis 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.\n","published":"2024-11-15T15:45:55.729Z","modified":"2026-10-28T02:30:59.494541644Z","cvss":{"score":4.8,"severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N"},"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Packagist","name":"librenms/librenms","fixedVersion":"24.10.0"}],"fix":{"url":"https://github.com/librenms/librenms/commit/aef739a438ffb507e927a4ec87b359164a7a053a","label":"librenms/librenms@aef739a"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/51xxx/CVE-2024-51496.json"},{"type":"ADVISORY","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":"FIX","url":"https://github.com/librenms/librenms/commit/aef739a438ffb507e927a4ec87b359164a7a053a"},{"type":"PACKAGE","url":"https://github.com/librenms/librenms"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-28T02:30:59.494541644Z"}}