XSS Vulnerability in WooCommerce Product Vendors plugin
The WooCommerce Product Vendors plugin fails to escape the vendor_description POST parameter, allowing reflected cross-site scripting. An attacker could execute arbitrary JavaScript in a victim's browser by crafting a malicious request.
Originally disclosed on HackerOne
- Disclosed after 28 days
Version 2.0.27 of the WooCommerce Product Vendors plugin doesn't appear to correctly escape the "vendor description" POST parameter and can be manipulated to reflect arbitrary scripting. The good news is that it does appear to do some form of clientside validation before posting, in addition to some serverside validation later, preventing this from becoming a stored attack. This appears to be due to the fact that "vendor_description" _POST parameter is echoed without being escaped on line 61 of templates/shortcode-registration-form.php
I've created the following vulnerable URL on my personal site; WordPress and all plugins and themes are up to date, and the site is using the default "Storefront" theme. http://steelpress.org/index.php/product-vendor-registration-form/
The unescaped script is visible in the source when you run:
curl -X POST -d "vendor_description=<script>alert("xss")</script>" "https://steelpress.org/index.php/product-vendor-registration-form/?confirm_email=1&email=1&firstname=1&lastname=1&location=1®ister=Register&username=1&vendor_description=1&vendor_name=1"
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
The vendor_description POST parameter is echoed without being escaped in templates/shortcode-registration-form.php on line 61.
Impact
An attacker could execute arbitrary JavaScript in a victim's browser, but client-side and server-side validation prevent this from becoming a stored attack.
What the attacker needed
Victim clicks a crafted link or submits a form
The fix
The vendor_description parameter should be properly escaped before being output.
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.
This plugin takes text from a form field and puts it directly into the web page without cleaning it. If an attacker sends a special request with a script in that field, the script runs in the victim's browser. This is called cross-site scripting (XSS).
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.