VYPR
Moderate severityNVD Advisory· Published Dec 1, 2021· Updated Aug 4, 2024

CVE-2021-44277

CVE-2021-44277

Description

Librenms 21.11.0 is affected by a Cross Site Scripting (XSS) vulnerability in includes/html/common/alert-log.inc.php.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
librenms/librenmsPackagist
<= 21.11.0

Affected products

2

Patches

Vulnerability mechanics

Root cause

"Missing output encoding of POST parameters before embedding them into HTML attributes allows stored/reflected Cross-Site Scripting."

Attack vector

An attacker can inject arbitrary JavaScript or HTML into the alert-log page by sending a crafted POST parameter (e.g. `state`, `min_severity`, or `device_id`) that contains a payload such as `"><script>alert(1)</script>` [CWE-79]. The input is echoed directly into the HTML `value` attribute without sanitization, so when a victim (typically an administrator) views the alert-log page, the script executes in their browser. No authentication bypass is required beyond having a valid session, and the attack can be delivered via a simple form submission or a crafted link that auto-submits the form.

Affected code

The vulnerability is located in `includes/html/common/alert-log.inc.php` (the file named in the CVE description) and was fixed by wrapping `$_POST['state']`, `$_POST['min_severity']`, and `$_POST['device_id']` with `htmlspecialchars()` [patch_id=6636045]. The same pattern of missing output encoding was also corrected in many other files such as `packages.inc.php`, `inventory.inc.php`, `bill.inc.php`, `mac.inc.php`, `arp.inc.php`, `showconfig.inc.php`, `sensor-alert-update.inc.php`, `delhost.inc.php`, and `api-access.inc.php` in the same commit [patch_id=6636045].

What the fix does

The patch wraps every unsanitized `$_POST` value with `htmlspecialchars()` before embedding it into HTML output [patch_id=6636045]. For example, in `alert-log.inc.php` the line `'<option value="' . $_POST['state'] . '"'` becomes `'<option value="' . htmlspecialchars($_POST['state']) . '"'`, which converts characters like `<`, `>`, `"`, and `&` into their safe HTML entities. This prevents an attacker-supplied payload from being interpreted as markup or JavaScript. The same fix is applied consistently across all the other files touched in the same commit.

Preconditions

  • authAttacker must have a valid session on the LibreNMS instance
  • inputThe victim (admin) must visit the alert-log page or any of the other affected pages
  • inputThe attacker can supply malicious input via POST parameters such as state, min_severity, or device_id

Generated on Jun 20, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

4

News mentions

0

No linked articles in our index yet.