Patch Diffing CVE-2023-28121 to Compromise a WooCommerce
The WooCommerce Payments plugin added a filter that trusted a request header to set the current WordPress user, allowing an attacker to impersonate any user including administrators. This could lead to full site compromise by creating a new administrator account.
Published on rcesecurity.com
Back in March 2023, I noticed an interesting security advisory that was published by Wordfence about a critical “Authentication Bypass and Privilege Escalation” (aka CVE-2023-28121 ) affecting the “WooCommerce Payments” plugin which has more than 600.000 active installs according to WordPress .
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could impersonate any active user, including administrators, and create a new administrator account, leading to full compromise of the WordPress instance.
What the attacker needed
Vulnerable WooCommerce Payments plugin (≤5.6.1); network access to the WordPress site
The fix
The vulnerable code was removed in version 5.6.2, which fixed the issue.
How it was found
- Send a request with the X-WCPAY-PLATFORM-CHECKOUT-USER header set to a user ID.
- Use the impersonated user (e.g., administrator) to call the WordPress users API and create a new administrator account.
- Log in with the new administrator account to access the WordPress admin backend.
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 write-up has not been written yet. The Original tab links to the source.
A plugin for WordPress (a popular website builder) added a feature that let a special request header tell the site who the user is. The plugin did not check if that header was real, so anyone could send it and pretend to be an administrator. This let attackers take over the whole site.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.