CVE-2021-29447
📋 TL;DR
WordPress users with file upload permissions (like Authors) can exploit an XML parsing vulnerability in the Media Library to perform XXE attacks when PHP 8 is used. This allows attackers to read internal files from the server. The vulnerability affects WordPress installations running PHP 8.
💻 Affected Systems
- WordPress
📦 What is this software?
Wordpress by Wordpress
⚠️ Risk & Real-World Impact
Worst Case
Complete server file disclosure including configuration files, database credentials, and sensitive system files leading to full system compromise.
Likely Case
Unauthorized access to sensitive WordPress files (wp-config.php), user data, and potentially other readable files on the web server.
If Mitigated
Limited impact with proper file permissions and network segmentation preventing access to critical system files.
🎯 Exploit Status
Exploit requires authenticated user with file upload permissions. Multiple public proof-of-concepts exist showing MP3 file upload exploitation.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: WordPress 5.7.1
Vendor Advisory: https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-rv47-pc52-qrhh
Restart Required: No
Instructions:
1. Update WordPress to version 5.7.1 or later via Dashboard > Updates. 2. For older versions, apply security patches from WordPress security releases. 3. Enable auto-updates for WordPress core.
🔧 Temporary Workarounds
Disable PHP 8
allRevert to PHP 7.x which is not vulnerable to this specific XXE issue
Contact hosting provider to downgrade PHP version to 7.4 or earlier
Restrict file uploads
allRemove file upload capabilities from Author roles and restrict to Administrators only
Use WordPress role management plugins or custom code to modify capabilities
🧯 If You Can't Patch
- Implement strict file upload validation to block XML-based file types
- Deploy WAF rules to detect and block XXE payloads in file uploads
🔍 How to Verify
Check if Vulnerable:
Check WordPress version (Dashboard > Updates) and PHP version (wp-admin/site-health.php or phpinfo()). If WordPress < 5.7.1 AND PHP version starts with 8.x, system is vulnerable.
Check Version:
wp core version (WP-CLI) or check Dashboard > Updates in WordPress admin
Verify Fix Applied:
Verify WordPress version is 5.7.1 or higher via Dashboard > Updates. Check that XML external entity processing is disabled in PHP configuration.
📡 Detection & Monitoring
Log Indicators:
- Multiple failed MP3/XML file upload attempts
- Unusual file uploads from Author-level users
- HTTP requests with XML entities in file uploads
Network Indicators:
- POST requests to /wp-admin/async-upload.php with XML content
- File uploads containing DOCTYPE declarations or ENTITY definitions
SIEM Query:
source="wordpress.log" AND ("async-upload" OR "upload.php") AND ("DOCTYPE" OR "ENTITY" OR "SYSTEM")
🔗 References
- http://packetstormsecurity.com/files/163148/XML-External-Entity-Via-MP3-File-Upload-On-WordPress.html
- http://packetstormsecurity.com/files/164198/WordPress-5.7-Media-Library-XML-Injection.html
- https://blog.sonarsource.com/wordpress-xxe-security-vulnerability/
- https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-rv47-pc52-qrhh
- https://lists.debian.org/debian-lts-announce/2021/04/msg00017.html
- https://wordpress.org/news/category/security/
- https://www.debian.org/security/2021/dsa-4896
- http://packetstormsecurity.com/files/163148/XML-External-Entity-Via-MP3-File-Upload-On-WordPress.html
- http://packetstormsecurity.com/files/164198/WordPress-5.7-Media-Library-XML-Injection.html
- https://blog.sonarsource.com/wordpress-xxe-security-vulnerability/
- https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-rv47-pc52-qrhh
- https://lists.debian.org/debian-lts-announce/2021/04/msg00017.html
- https://wordpress.org/news/category/security/
- https://www.debian.org/security/2021/dsa-4896