XSS in DynamicModelChoiceField #8130

Closed
opened 2025-12-29 20:32:49 +01:00 by adam · 0 comments
Owner

Originally created by @kkthxbye-code on GitHub (May 28, 2023).

Originally assigned to: @kkthxbye-code on GitHub.

NetBox version

v3.5.2

Python version

3.10

Steps to Reproduce

  1. Create a tenant group with the name <img src=1 onerror='alert(document.cookie)'/>
  2. Go to the site creation form
  3. Open the tenant group dropdown

Expected Behavior

No XSS

Observed Behavior

The name is not escaped and the browser displays an alert with the cookie. Originally found here: https://github.com/anhdq201/netbox/issues

This probably applies to all DynamicModelChoiceField where the user can set the display value.

The person responsible for that repo chose not to report it. The same report is also duplicated 15 times and one report is invalid (the graphql one).

Originally created by @kkthxbye-code on GitHub (May 28, 2023). Originally assigned to: @kkthxbye-code on GitHub. ### NetBox version v3.5.2 ### Python version 3.10 ### Steps to Reproduce 1. Create a tenant group with the name `<img src=1 onerror='alert(document.cookie)'/>` 2. Go to the site creation form 3. Open the tenant group dropdown ### Expected Behavior No XSS ### Observed Behavior The name is not escaped and the browser displays an alert with the cookie. Originally found here: https://github.com/anhdq201/netbox/issues This probably applies to all DynamicModelChoiceField where the user can set the display value. The person responsible for that repo chose not to report it. The same report is also duplicated 15 times and one report is invalid (the graphql one).
adam added the type: bugstatus: accepted labels 2025-12-29 20:32:49 +01:00
adam closed this issue 2025-12-29 20:32:49 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8130