# CVE-2021-31274: Cross-site Scripting in LibreNMS

- Severity: Medium 5.4 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.77%, higher than 56% of CVEs (2026-12-01)
- Published: 2021-09-08T17:12:29.000Z
- Modified: 2026-06-17T03:51:31.777Z
- Also known as: GHSA-2r2w-jrh2-p4gr
- Weaknesses: CWE-79
- Assigned by: mitre

## Description

In LibreNMS < 21.3.0, a stored XSS vulnerability was identified in the API Access page due to insufficient sanitization of the $api->description variable. As a result, arbitrary Javascript code can get executed.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- librenms/librenms (Packagist): before 21.3.0
- librenms librenms: before 21.3.0

## Every score

- GitHub: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N`
- NVD: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N`
- NVD: CVSS:2.0 3.5 Low `AV:N/AC:M/Au:S/C:N/I:P/A:N`

## References

- <https://community.librenms.org/t/vulnerability-report-cross-site-scripting-xss-in-the-api-access-page/15431> (vendor-advisory, web)
- <https://github.com/librenms/librenms> (product, third-party-advisory, web)
- <https://github.com/librenms/librenms/pull/12739> (patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-31274> (advisory)

## Sources

- CVE List: [CVE-2021-31274](https://www.cve.org/CVERecord?id=CVE-2021-31274), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-2r2w-jrh2-p4gr](https://github.com/advisories/GHSA-2r2w-jrh2-p4gr), CC-BY-4.0, modified 2024-02-16
- NVD: [CVE-2021-31274](https://nvd.nist.gov/vuln/detail/CVE-2021-31274), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-31274 · Whole record: https://cve.day/CVE-2021-31274.json · Rebuilt by cve.day 2026-11-25T22:58:03.811Z
