Reflected XSS via rp4wp_parent in barrykooij/related-posts-for-wp
Reported on
Sep 20th 2022
Description
The rp4wp_parent value is echoed without encoding, leading to reflected XSS.
Proof of Concept
Install wordpress, install the "Related Posts for WordPress" plugin, then visit the following URL, where localhost
is the server hosting the app:
http://localhost/wordpress/wp-admin/admin.php?page=rp4wp_link_related&rp4wp_parent=156x%27%22%3E%3Cimg+src%3Dx+onerror%3Dalert%281%29%3E
Impact
With a successful attack, an attacker can access all data the attacked user has access to, as well as perform arbitrary requests in the name of the attacked user.
In the case of a default wordpress installation, the attacker could eg add a new admin user and gain RCE via the plugin/theme editor.
Occurrences
class-hook-link-related-screen.php L154-L169
Value is read from $_GET['rp4wp_parent'];
, stored in $parent
, passed to $cancel_url
and then echoed without encoding.
SECURITY.md
a year ago
Thank you for your report, I will fix this over the weekend!