CVE-2024-4397
📋 TL;DR
The LearnPress WordPress LMS plugin has a vulnerability that allows authenticated attackers with Instructor-level permissions or higher to upload arbitrary files due to missing file type validation. This can lead to remote code execution on affected WordPress sites. The vulnerability affects versions up to and including 4.2.6.5.
💻 Affected Systems
- LearnPress - WordPress LMS Plugin
📦 What is this software?
Learnpress by Thimpress
⚠️ Risk & Real-World Impact
Worst Case
Full server compromise through remote code execution, allowing attackers to install malware, steal data, or pivot to other systems.
Likely Case
Attackers upload web shells to gain persistent access, deface websites, or deploy ransomware.
If Mitigated
If proper file upload restrictions and web application firewalls are in place, exploitation attempts are blocked or detected.
🎯 Exploit Status
Exploitation requires Instructor-level credentials; file upload bypass is straightforward once authenticated.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 4.2.6.6 or later
Vendor Advisory: https://plugins.trac.wordpress.org/changeset/3083657/
Restart Required: No
Instructions:
1. Log into WordPress admin panel. 2. Navigate to Plugins > Installed Plugins. 3. Find LearnPress plugin. 4. Click 'Update Now' if update is available. 5. Alternatively, download version 4.2.6.6+ from WordPress repository and manually update.
🔧 Temporary Workarounds
Restrict File Uploads via .htaccess
linuxBlock execution of uploaded files in the uploads directory
Add to .htaccess in wp-content/uploads: <FilesMatch "\.(php|php5|php7|phtml|phar)$">
Order Allow,Deny
Deny from all
</FilesMatch>
Web Application Firewall Rule
allBlock suspicious file upload requests to LearnPress endpoints
Configure WAF to block requests to /wp-json/lp/v1/material with file uploads containing executable extensions
🧯 If You Can't Patch
- Temporarily disable the LearnPress plugin until patched
- Remove Instructor and higher role permissions from untrusted users
🔍 How to Verify
Check if Vulnerable:
Check WordPress admin > Plugins > LearnPress version; if version is 4.2.6.5 or lower, you are vulnerable.
Check Version:
wp plugin list --name=learnpress --field=version (if WP-CLI installed)
Verify Fix Applied:
After updating, verify LearnPress version is 4.2.6.6 or higher in WordPress plugins list.
📡 Detection & Monitoring
Log Indicators:
- POST requests to /wp-json/lp/v1/material with file uploads
- Unauthorized file creations in wp-content/uploads with .php extensions
Network Indicators:
- HTTP POST requests to material endpoint with multipart/form-data containing executable files
SIEM Query:
source="web_server" AND uri_path="/wp-json/lp/v1/material" AND http_method="POST" AND content_type="multipart/form-data"
🔗 References
- https://plugins.trac.wordpress.org/browser/learnpress/tags/4.2.6.5/inc/rest-api/v1/frontend/class-lp-rest-material-controller.php#L98
- https://plugins.trac.wordpress.org/changeset/3083657/
- https://www.wordfence.com/threat-intel/vulnerabilities/id/ec20d5c4-4c41-4ec9-8d0a-ec8f03634f7d?source=cve
- https://plugins.trac.wordpress.org/browser/learnpress/tags/4.2.6.5/inc/rest-api/v1/frontend/class-lp-rest-material-controller.php#L98
- https://plugins.trac.wordpress.org/changeset/3083657/
- https://www.wordfence.com/threat-intel/vulnerabilities/id/ec20d5c4-4c41-4ec9-8d0a-ec8f03634f7d?source=cve