CVE-2022-2440·PHP vulnerability
The Theme Editor plugin for WordPress is vulnerable to deserialization of untrusted input via the 'images_array' parameter in versions up to, and including 2.8. This makes it possible for authenticated attackers with administrative privileges to call files using a PHAR wrapper that will deserialize and call arbitrary PHP Objects that can be used to perform a variety of malicious actions granted a POP chain is also present. It also requires that the attacker is successful in uploading a file with the serialized payload.
- Severity
- high
- Software
- PHP
- Fixed in
- 2.9
- Published
- 2024-08-29
Affected versions
Until: 2.9
Fixed in: 2.9
How to fix this CVE
Update PHP to version 2.9 or later to patch the unsafe deserialization vulnerability in the Theme Editor plugin. This vulnerability allows authenticated administrators to execute arbitrary PHP code through malicious serialized objects. Ensure your WordPress installation and all plugins are fully updated, and consider restricting administrative access to trusted users only.
sudo dnf update phpDefensia detects this vulnerability
What an exploitation attempt looks like
Sample log line indicative of exploitation attempts:
POST requests to wp-admin/admin-ajax.php containing 'images_array' parameter with base64-encoded or serialized PHP object data (O:[0-9]+:"[a-zA-Z0-9_]+":); file uploads to wp-content/ directories with .phar extensions or suspicious serialized content prefixed with phar://WAF mitigation (if patching is not yet possible)
Add this rule to your WAF to block exploitation attempts while you schedule the patch.
Block or sanitize POST requests to wp-admin endpoints containing serialized PHP object patterns (regex: O:[0-9]+:"[a-zA-Z0-9_]+"; or phar:// protocol usage). Restrict file uploads to whitelisted extensions only and implement strict Content-Type validation.How to check if you are affected
- Step 1: Check installed PHP version with `php -v` to confirm the current version running on your system
- Step 2: List all installed WordPress plugins with `wp plugin list --allow-root` to verify if Theme Editor plugin is present and identify its version
- Step 3: Search web server access and error logs for POST requests to `/wp-admin/admin-ajax.php` with `images_array` parameters, or grep for PHAR wrapper usage patterns: `grep -r 'phar://' /var/www/html/wp-content/`
- Step 4: After updating, re-run `php -v` and verify Theme Editor plugin version shows 2.9 or higher via `wp plugin list --allow-root | grep theme-editor`
Indicators of compromise
- POST parameter 'images_array' containing serialized object notation O:*:"
- phar:// protocol wrapper in file paths
- .phar file uploads to wp-content/uploads/
FAQ
What is CVE-2022-2440?
CVE-2022-2440 is a critical deserialization vulnerability in WordPress Theme Editor plugin (versions up to 2.8) that allows authenticated administrators to instantiate arbitrary PHP objects and execute remote code by uploading files containing malicious serialized payloads.
Is CVE-2022-2440 being actively exploited?
No, CVE-2022-2440 is not listed in the CISA KEV catalog and no public exploits are currently available, though the vulnerability is trivial to exploit for authorized users with file upload access.
What versions of PHP are affected by CVE-2022-2440?
The Theme Editor plugin versions up to and including 2.8 are vulnerable. Version 2.9 and later contain the fix. This affects all PHP installations running WordPress with the vulnerable plugin versions.
How do I check if my server is vulnerable to CVE-2022-2440?
Run `wp plugin list --allow-root | grep theme-editor` to identify the plugin version, or inspect the plugin's `ms_child_theme_editor.php` file at line 495 to verify if `unserialize()` is still being called on user-supplied input without validation.
Does Defensia detect CVE-2022-2440?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If PHP is installed on a monitored server, CVE-2022-2440 will appear in your dashboard with remediation steps.
Related PHP CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2022-2440. Free for 1 server.
Get started free