Cross-site Scripting (XSS) - Reflected in blockonomics/woocommerce-plugin
Reported on
May 1st 2021
✍️ Description
Reflected javascript injection vulnerabilities exist when web applications take parameters from the URL and display them on a page. Reflection vulnerabilities occur when a website outputs a variable from the webpage URL directly to the page, such as in a PHP application that accepts parameters and displays them on screen. If javascript code is passed into the PHP script and output to the page, the browser may be tricked into treating it like other javascript and executing it.
🕵️♂️ Proof of Concept
Vulnerable code snippet available at https://github.com/blockonomics/woocommerce-plugin/blob/master/blockonomics-woocommerce.php
User controlled GET parameter filter_by
is reflected directly inside the input tag without sanitization.
function filter_orders() {
global $typenow;
if ( 'shop_order' === $typenow ) {
?>
<input size='26' value="<?php if(isset( $_GET['filter_by'] )) echo($_GET['filter_by']); ?>" type='name' placeholder='Filter by crypto address/txid' name='filter_by'>
<?php
}
}
💥 Impact
Reflected XSS can be used to bypass Same Origin Policy which can be leveraged to perform any action which a user can do manually using the attacker controlled javascript.
References
- Reflected javascript injection vulnerabilities exist when web applications take parameters from the URL and display them on a page. URL reflection XSS attacks are a type of attack that does not rely on saving malicious code in a database, but rather hiding it in URLs and for sending to unsuspecting victims. Reflection vulnerabilities occur when a website outputs a variable from the webpage URL directly to the page, such as in a PHP application that accepts parameters and displays them on screen. If javascript code is passed into the PHP script and output to the page, the browser may be tricked into treating it like other javascript and executing it.
- https://github.com/blockonomics/woocommerce-plugin/blob/master/blockonomics-woocommerce.php
Hey,
Does it qualify for a CVE??? As this bug is reported in a WordPress plugin, I believe it should qualify for the CVE number. Please let me know