CVE-2024-9707
📋 TL;DR
The Hunk Companion WordPress plugin has an unauthenticated REST API vulnerability that allows attackers to install and activate arbitrary plugins. This can lead to remote code execution if another vulnerable plugin is available. All WordPress sites using Hunk Companion version 1.8.4 or earlier are affected.
💻 Affected Systems
- WordPress Hunk Companion plugin
📦 What is this software?
Hunk Companion by Themehunk
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution leading to complete site compromise, data theft, malware distribution, or site defacement.
Likely Case
Attackers install malicious plugins to gain persistent access, create backdoors, or deploy cryptocurrency miners.
If Mitigated
Attackers can still install plugins but cannot achieve RCE without additional vulnerable plugins.
🎯 Exploit Status
Simple HTTP POST request to vulnerable endpoint. Public exploit code available in references.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 1.8.5
Vendor Advisory: https://wordpress.org/plugins/hunk-companion/#developers
Restart Required: No
Instructions:
1. Log into WordPress admin panel. 2. Go to Plugins → Installed Plugins. 3. Find Hunk Companion. 4. Click 'Update Now' if available. 5. If no update appears, manually download version 1.8.5+ from WordPress.org and replace plugin files.
🔧 Temporary Workarounds
Disable Hunk Companion plugin
allTemporarily deactivate the vulnerable plugin until patched.
wp plugin deactivate hunk-companion
Block vulnerable REST endpoint
linuxAdd .htaccess rule to block access to the vulnerable API endpoint.
RewriteEngine On
RewriteRule ^wp-json/hc/v1/themehunk-import - [F,L]
🧯 If You Can't Patch
- Implement web application firewall (WAF) rules to block requests to /wp-json/hc/v1/themehunk-import
- Restrict WordPress REST API access to authenticated users only using security plugins
🔍 How to Verify
Check if Vulnerable:
Check WordPress admin panel → Plugins → Hunk Companion version. If version ≤1.8.4, vulnerable.
Check Version:
wp plugin get hunk-companion --field=version
Verify Fix Applied:
Verify Hunk Companion version is 1.8.5 or higher in WordPress admin.
📡 Detection & Monitoring
Log Indicators:
- POST requests to /wp-json/hc/v1/themehunk-import from unauthenticated users
- Sudden plugin installations in WordPress logs
Network Indicators:
- HTTP POST to /wp-json/hc/v1/themehunk-import with plugin installation payloads
SIEM Query:
source="wordpress.log" AND (uri="/wp-json/hc/v1/themehunk-import" OR message="*plugin installed*")
🔗 References
- https://github.com/WordPressBugBounty/plugins-hunk-companion/blob/5a3cedc7b3d35d407b210e691c53c6cb400e4051/hunk-companion/import/app/app.php#L46
- https://plugins.trac.wordpress.org/changeset?sfp_email=&sfph_mail=&reponame=&old=3166501%40hunk-companion&new=3166501%40hunk-companion&sfp_email=&sfph_mail=
- https://wordpress.org/plugins/hunk-companion/
- https://www.wordfence.com/threat-intel/vulnerabilities/id/9c101fca-037c-4bed-9dc7-baa021a8b59c?source=cve