Exploiting authorization by nonce in WordPress plugins
Many WordPress plugins use nonces as the sole authorization check, allowing low-privileged or unauthenticated users to perform privileged actions. The author found three critical vulnerabilities: arbitrary file upload leading to remote code execution in Advanced File Manager and Filester, and a semi-blind SQL injection in Squirrly SEO.
Published on nowotarski.info
As of 2024, WordPress powers 43% of all websites in the internet. 474 million websites run WordPress software and one or more out of 70 000 plugins.
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
Root cause
Likely the plugins rely on nonce verification alone for authorization, without checking user capabilities or authentication.
Impact
An attacker with low privileges could upload and execute arbitrary PHP code, leading to full site compromise; the Advanced File Manager issue was not fixed by the developer, while the Filester issue was fixed in version 1.8.3.
What the attacker needed
Access to the plugin (e.g., Subscriber role); valid nonce from frontend
The fix
The Filester vulnerability was fixed in version 1.8.3; the Advanced File Manager issue was not fixed by the developer.
How it was found
- Obtain a valid nonce from the plugin's frontend code.
- Send a request to the AJAX action to change plugin settings, removing file upload restrictions.
- Upload a .htaccess file that makes Apache treat a custom extension as PHP.
- Upload a file with that custom extension containing PHP code.
- Access the uploaded file to execute commands.
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 nonce is a one-time token meant to prevent cross-site request forgery, not to prove who a user is. When plugins treat a valid nonce as permission to do something, any user who can see that token (often any logged-in user) can perform actions meant only for administrators. This can let an attacker upload malicious files or read the database.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.