Skip to content
XSS Disclosed report Beginner

DOM based XSS in the WooCommerce plugin

The WooCommerce order page outputs the state field without escaping, allowing an attacker to inject a script that executes when the page is viewed. This could let an attacker run arbitrary JavaScript in the context of an authenticated admin.

wild0ni0n Follow

Originally disclosed on HackerOne

Medium 5.4 View original
  • Fixed in 18 days
  • Paid in 18 days
  • Disclosed after 57 days

I have found a stored DOM based XSS in the order page at WooCommerce 3.5.6.

The Data input from HTML element name _shipping_state and _billing_state in order page outputs data without escaping.When the victim read the page containing the payload, it executes the script.

Steps to reproduce

  1. From a Wordpress admin menu, naavigate to WooCommerce page.
  2. Click to Add order (Or select to the exist order data, navigate to edit page.)
  3. Click to pencil icon of Billing or Shipping items, and expand input form.
  4. Select to Select a country... by Country item.
  5. Input following value in State / Country item.

"><img src=/ onerror="alert(location.host)"

  1. Click Create button.(If navigated from the exist order, click update.)
  2. Navigate to edit page, after then an alert displayed.

See also attached screenshot.

The security impact is the same as any typical XSS.

Impact

The security impact is the same as any typical XSS.

Attachments

xss.png
xss.png From the original on HackerOne

The original report as published on HackerOne, by wild0ni0n. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the application fails to escape user-supplied input when rendering the state field in the order page.

Impact

The security impact is the same as any typical XSS.

What the attacker needed

Admin access to WooCommerce; ability to create or edit an order

How it was found

  1. From a Wordpress admin menu, navigate to WooCommerce page.
  2. Click to `Add order` (Or select to the exist order data, navigate to edit page.)
  3. Click to pencil icon of `Billing` or `Shipping` items, and expand input form.
  4. Select to `Select a country...` by Country item.
  5. Input following value in State / Country item.
  6. Click Create button.(If navigated from the exist order, click update.)

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

The order page shows the state you entered without cleaning it up, so special code runs as a script in the browser when the page is viewed.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More from Automattic

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.