high CVSS 7.2

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 php

Defensia 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

  1. Step 1: Check installed PHP version with `php -v` to confirm the current version running on your system
  2. 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
  3. 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/`
  4. 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

CVE-2025-47916CVSS 10Invision Community 5.0.0 before 5.0.7 allows remote code execution via crafted template strings to themeeditor.php. The issue lies within the themeeditor controller (file: /applications/core/modules/front/system/themeeditor.php), where a protected method named customCss can be invoked by unauthenticated users. This method passes the value of the content parameter to the Theme::makeProcessFunction() method; hence it is evaluated by the template engine. Accordingly, this can be exploited by unauthenticated attackers to inject and execute arbitrary PHP code by providing crafted template strings.
CVE-2026-39337CVSS 10ChurchCRM is an open-source church management system. Prior to 7.1.0, critical pre-authentication remote code execution vulnerability in ChurchCRM's setup wizard allows unauthenticated attackers to inject arbitrary PHP code during the initial installation process, leading to complete server compromise. The "$dbPassword" variable is not sanitized. This vulnerability exists due to an incomplete fix for CVE-2025-62521. This vulnerability is fixed in 7.1.0.
CVE-2024-5932CVSS 10The GiveWP – Donation Plugin and Fundraising Platform plugin for WordPress is vulnerable to PHP Object Injection in all versions up to, and including, 3.14.1 via deserialization of untrusted input from the 'give_title' parameter. This makes it possible for unauthenticated attackers to inject a PHP Object. The additional presence of a POP chain allows attackers to execute code remotely, and to delete arbitrary files.
CVE-2025-46348CVSS 10YesWiki is a wiki system written in PHP. Prior to version 4.5.4, the request to commence a site backup can be performed and downloaded without authentication. The archives are created with a predictable filename, so a malicious user could create and download an archive without being authenticated. This could result in a malicious attacker making numerous requests to create archives and fill up the file system, or by downloading the archive which contains sensitive site information. This issue has been patched in version 4.5.4.
CVE-2025-25174CVSS 10Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion') vulnerability in beeteam368 BeeTeam368 Extensions beeteam368-extensions allows PHP Local File Inclusion.This issue affects BeeTeam368 Extensions: from n/a through <= 1.9.4.

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