Summary
LibreNMS renders several JSON fields from its administrator-configured Oxidized integration without HTML escaping, allowing attacker-controlled content to become persistent cross-site scripting in the device showconfig page. The issue becomes risky when an administrator configures the integration URL to retrieve data from an attacker-controlled or otherwise untrusted server, potentially affecting every user who views the impacted page.
Affected context
The vulnerability occurs in LibreNMS deployments that use the Oxidized integration and display response fields such as device name, IP address, model, author, or commit message on the device showconfig page. It requires an administrator-controlled integration URL to return content that is not treated as trusted display data, combined with rendering logic that does not apply context-appropriate HTML encoding before presentation to users.
Exploit preconditions
- Attack surface: The LibreNMS web interface and its Oxidized integration response handling
- Required access: The ability to influence the configured Oxidized endpoint or cause that endpoint to return attacker-controlled JSON
- Trigger point: A user viewing a device's showconfig tab after the response data has been processed
- Why exploitation is possible: JSON values are inserted into an HTML-rendered page without sufficient output encoding, allowing data from an untrusted integration response to be interpreted as browser script content
Why this happens
The underlying bug is improper neutralization of user-controlled data in a web page, mapping to CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). LibreNMS treats fields obtained from an administrator-configurable external integration as trusted text and renders them without applying the required HTML escaping for the output context. This breaks the boundary between data and markup and allows persistent attacker-controlled content to execute when the affected page is rendered.
Potential impact
- Malicious script content may execute in the browsers of users viewing an affected showconfig page
- User sessions or authentication context may be exposed
- An attacker could perform actions with the privileges of a targeted user
- Sensitive information displayed in the LibreNMS interface could be accessed
- Monitoring data or administrative settings could be altered
General mitigation guidance
Mitigation generally focuses on treating all external integration responses as untrusted and applying context-appropriate output encoding at every HTML rendering boundary.
Common defensive patterns include:
- Escaping JSON-derived values before inserting them into HTML
- Using framework templating features that encode output by default
- Validating integration responses against a strict schema and expected data types
- Restricting integration endpoints to trusted destinations through allowlists and network policy
- Separating administrative configuration privileges from routine monitoring access
- Applying Content Security Policy controls as a defense-in-depth measure
- Avoiding unsafe client-side DOM APIs for inserting external values
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis rules that identify unescaped variables in HTML templates or DOM-writing code
- Code review checks for data returned by integrations, APIs, webhooks, and other external sources
- Tests that place benign marker characters in every externally sourced field and verify correct encoding in rendered pages
- Policy enforcement requiring output encoding and trusted templating primitives for web responses
- Monitoring configuration changes to integration URLs and reviewing unusual endpoint destinations
- Automated application security testing that evaluates persistent input flows from external responses to browser-rendered output

