CVE-2019-25217
📋 TL;DR
The SiteGround Optimizer WordPress plugin up to version 5.0.12 contains an authorization bypass vulnerability in its REST API endpoint. This allows unauthenticated attackers to execute arbitrary PHP code on the server through file inclusion, leading to complete system compromise. All WordPress sites using vulnerable versions of this plugin are affected.
💻 Affected Systems
- SiteGround Optimizer WordPress Plugin
📦 What is this software?
Speed Optimizer by Siteground
⚠️ Risk & Real-World Impact
Worst Case
Complete server takeover: attackers can execute arbitrary commands, steal sensitive data, install backdoors, deface websites, or pivot to internal networks.
Likely Case
Website defacement, data theft, cryptocurrency mining malware installation, or ransomware deployment.
If Mitigated
Limited impact if proper network segmentation, file integrity monitoring, and least privilege principles are implemented.
🎯 Exploit Status
Exploitation requires sending crafted HTTP requests to the vulnerable REST API endpoint. Public exploit code is available.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 5.0.13 and later
Vendor Advisory: https://www.siteground.com/blog/siteground-optimizer-plugin-security-update/
Restart Required: No
Instructions:
1. Log into WordPress admin panel. 2. Navigate to Plugins → Installed Plugins. 3. Find SiteGround Optimizer. 4. Click 'Update Now' if available. 5. If no update appears, manually download version 5.0.13+ from WordPress.org and replace the plugin files.
🔧 Temporary Workarounds
Disable REST API endpoint
allRemove or restrict access to the vulnerable /switch-php REST API route
Add to wp-config.php: define('SG_OPTIMIZER_REST_DISABLED', true);
Web Application Firewall rule
allBlock requests to the vulnerable endpoint
WAF rule: Block POST requests to */wp-json/sg-cachepress/v1/switch-php*
🧯 If You Can't Patch
- Immediately disable or remove the SiteGround Optimizer plugin
- Implement strict network ACLs to limit access to WordPress admin interfaces
🔍 How to Verify
Check if Vulnerable:
Check WordPress admin → Plugins → SiteGround Optimizer → Version. If version is 5.0.12 or lower, you are vulnerable.
Check Version:
wp plugin list --name='SiteGround Optimizer' --field=version
Verify Fix Applied:
Confirm plugin version is 5.0.13 or higher in WordPress admin panel.
📡 Detection & Monitoring
Log Indicators:
- HTTP POST requests to /wp-json/sg-cachepress/v1/switch-php
- Unusual PHP file inclusions in web server logs
- Sudden appearance of unfamiliar PHP files in upload directories
Network Indicators:
- Outbound connections to suspicious IPs from web server
- Unusual spikes in traffic to REST API endpoints
SIEM Query:
source="web_server" AND (uri_path="/wp-json/sg-cachepress/v1/switch-php" OR php_include="*" )