netbox-data-flows Stored XSS Vulnerability in ObjectAlias Names
The netbox-data-flows plugin is vulnerable to stored cross-site scripting (XSS). An authenticated user with permissions to create or edit ObjectAlias objects can inject arbitrary HTML/JavaScript into the alias name. This payload is then rendered unescaped in DataFlow table views, leading to XSS when another user views the affected page. Successful exploitation can result in session theft, privileged action execution, and data exfiltration.
The netbox-data-flows plugin for NetBox is susceptible to a stored cross-site scripting (XSS) vulnerability (<=1.5.0). An attacker with authenticated access to create or modify ObjectAlias objects can inject malicious HTML/JavaScript code into the name field of an alias. This injected code is then rendered without proper sanitization within the DataFlow table views. When another user, particularly one with elevated privileges, views a DataFlow that includes the malicious alias, the injected script executes within their browser session. This can lead to session hijacking, unauthorized actions performed on behalf of the victim user, and the potential exfiltration of sensitive data from the NetBox instance. This vulnerability impacts any page rendering DataFlowTable, including the main Data Flow list page and model tabs that reuse DataFlowTable.
Attack Chain
- Attacker logs into NetBox with valid credentials and permissions to create/edit
ObjectAliasobjects. - Attacker creates a new
ObjectAliasobject. - Within the
namefield of theObjectAlias, the attacker injects a malicious JavaScript payload such as<img src=x onerror=alert(document.domain)>. - Attacker creates or edits a
DataFlowobject. - The attacker associates the malicious
ObjectAliaswith either thesourcesordestinationsfield of theDataFlowobject. - The victim user logs into NetBox and navigates to the Data Flow list page or any page rendering the
DataFlowTable. - The
DataFlowTableattempts to render thesourcesordestinationswhich contains the maliciousObjectAlias. Theobject_list_to_string()function innetbox_data_flows/utils/helpers.pygenerates HTML using the unescapedObjectAlias.namefield. - The injected JavaScript within the
ObjectAlias.nameexecutes in the victim’s browser, potentially leading to session theft or unauthorized actions.
Impact
This stored XSS vulnerability in netbox-data-flows can affect any authenticated NetBox user who views a page rendering the affected DataFlow table. The impact is amplified when higher-privileged users are targeted. Successful exploitation allows an attacker to steal user sessions, perform privileged actions on behalf of the victim, and exfiltrate sensitive data accessible within NetBox. The vulnerability affects versions 1.5.0 and earlier of the netbox-data-flows plugin.
Recommendation
- Upgrade the
netbox-data-flowsplugin to a version greater than 1.5.0 to remediate the vulnerability (Affected Packages). - Deploy the Sigma rule “Detect netbox-data-flows XSS Payload in ObjectAlias Name” to detect attempts to create
ObjectAliasobjects with malicious payloads in thenamefield (rules). - Monitor NetBox logs for suspicious activity related to
ObjectAliascreation and modification (logsource). - Review existing
ObjectAliasobjects for any potentially malicious code in thenamefield (ObjectAlias.name).
Detection coverage 2
Detect netbox-data-flows XSS Payload in ObjectAlias Name
highDetects attempts to create ObjectAlias objects with potential XSS payloads in the name field.
Detect netbox-data-flows XSS Payload in ObjectAlias Edit
highDetects attempts to edit ObjectAlias objects and inject XSS payloads in the name field.
Detection queries are available on the platform. Get full rules →