CVE-2026-27016: LibreNMS has Stored XSS in Custom OID - unit parameter missing strip_tags()

Published Feb 18, 2026
·
Updated

Summary The unit parameter in Custom OID functionality lacks striptags() sanitization while other fields (name, oid, datatype) are sanitized. The unsanitized value is stored in the database and rendered without HTML escaping, allowing Stored XSS.

Details Vulnerable Input Processing (includes/html/forms/customoid.inc.php lines 18-21): php $name = striptags((string) $POST['name']); // line 18 - SANITIZED $oid = striptags((string) $POST['oid']); // line 19 - SANITIZED $datatype = striptags((string) $POST['datatype']); // line 20 - SANITIZED $unit = $POST['unit']; // line 21 - NOT SANITIZED!

Vulnerable Output (graphs/customoid.inc.php lines 13-20): php $customoidunit = $customoid['customoidunit']; // Retrieved from DB $customoidcurrent = \LibreNMS\Util\Number::formatSi(...) . $customoidunit; echo "...$customoidcurrent..."; // ECHOED WITHOUT ESCAPING!

PoC

python #!/usr/bin/env python3 """ XSS test for LibreNMS Custom OID - unit parameter """

import html as htmlmodule import re

def striptags(value): return re.sub(r'<[^>]?>', '', str(value))

Simulate form processing (customoid.inc.php lines 18-21) testinputs = { 'name': '<script>alert(1)</script>Test OID', 'oid': '1.3.6.1.4.1.2021.10.1.3.1', 'datatype': 'GAUGE', 'unit': '<script>alert("XSS")</script>', }

name = striptags(testinputs['name']) # Sanitized oid = striptags(testinputs['oid']) # Sanitized datatype = striptags(testinputs['datatype']) # Sanitized unit = testinputs['unit'] # NOT SANITIZED!

print("Input Processing Analysis:") print(f" name (striptags): {name}") print(f" oid (striptags): {oid}") print(f" datatype (striptags): {datatype}") print(f" unit (NO striptags): {unit}") print() print(" VULNERABILITY: 'unit' parameter has NO striptags()! ")

Test XSS payloads payloads = [ '<script>alert("XSS")</script>', '<img src=x onerror=alert(1)>', '<svg onload=alert(1)>', ]

print("\nXSS Payload Tests:") for payload in payloads: escaped = htmlmodule.escape(payload) hasxss = '<script>' in payload or 'onerror=' in payload.lower() print(f" Payload: {payload}") print(f" Raw (vulnerable): Contains executable code: {hasxss}") print(f" Escaped (safe): {escaped}")

Expected Output

Input Processing Analysis: name (striptags): alert(1)Test OID oid (striptags): 1.3.6.1.4.1.2021.10.1.3.1 datatype (striptags): GAUGE unit (NO striptags): <script>alert("XSS")</script>

VULNERABILITY: 'unit' parameter has NO striptags()! Impact - Attack Vector: User with device edit permissions sets malicious Unit value - Exploitation: XSS payload stored in database, executes for all users viewing device graphs - Consequences: - Session hijacking via cookie theft - Admin account takeover - Malicious actions on behalf of victims - Persistent attack affecting all users - Affected Users: All LibreNMS installations with Custom OID feature

Other sources

LibreNMS is an auto-discovering PHP/MySQL/SNMP based network monitoring tool. Versions 24.10.0 through 26.1.1 are vulnerable to Stored XSS via the unit parameter in Custom OID. The Custom OID functionality lacks striptags() sanitization while other fields (name, oid, datatype) are sanitized. The unsanitized value is stored in the database and rendered without HTML escaping. This issue is fixed in version 26.2.0.

MITRE

Affected Software

2 affected componentsFixes available
composer/librenms/librenms>=24.10.0<26.2.0
26.2.0
librenms librenms>=24.10.0<26.2.0

Event History

Feb 18, 2026
Advisory Published
via GitHub·10:08 PM
Data Sourced
via GitHub·10:08 PM
DescriptionSeverityWeaknessAffected Software
Feb 20, 2026
CVE Published
via MITRE·01:34 AM
Data Sourced
via MITRE·01:34 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·02:16 AM
RemedyDescriptionSeverityWeaknessAffected Software
May 15, 58112
Event
via FIRST·06:17 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-27016?

CVE-2026-27016 is classified as a medium severity vulnerability due to its potential for stored cross-site scripting (XSS) attacks.

2

How do I fix CVE-2026-27016?

To mitigate CVE-2026-27016, upgrade LibreNMS to version 26.2.0 or later.

3

What is the impact of CVE-2026-27016?

The impact of CVE-2026-27016 includes the risk of unauthorized script execution in the user’s browser, potentially leading to data theft or session hijacking.

4

What component of LibreNMS is affected by CVE-2026-27016?

CVE-2026-27016 affects the Custom OID functionality within the LibreNMS application.

5

Is the 'unit' parameter in CVE-2026-27016 sanitized?

No, the 'unit' parameter in CVE-2026-27016 is not sanitized using strip_tags(), making it vulnerable to XSS.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203