Summary
This advisory addresses a PHP Object Injection vulnerability in the Enable Media Replace plugin. The vulnerability affects plugin versions 4.1.4 through 4.2.2. A patch is available in version 4.2.3. Public Proof of Concept (PoC) code exists for this vulnerability.
Affected and patched versions
Enable Media Replace (plugin enable-media-replace): affected 4.1.4 through 4.2.2; fixed in 4.2.3
Is my site vulnerable?
To determine if your WordPress site uses a vulnerable version of the Enable Media Replace plugin, follow these steps:
Log in to your WordPress administration dashboard.
Navigate to the "Plugins" menu item, then select "Installed Plugins".
Locate "Enable Media Replace" in the list of installed plugins.
Check the version number displayed next to the plugin name.
If the version number is between 4.1.4 and 4.2.2, your site is running a vulnerable version of the plugin. If the version is 4.2.3 or higher, the patch has been applied.
What an attacker actually does
The Enable Media Replace plugin for WordPress contains a PHP Object Injection vulnerability in versions 4.1.4 through 4.2.2. This vulnerability stems from the plugin's deserialization of untrusted input. Deserialization is the process of converting a string representation of an object back into a live PHP object. When this process occurs with data that has not been properly validated or sanitized, it creates an opportunity for attackers to inject malicious PHP objects.
An unauthenticated attacker can send crafted data containing a PHP object. The plugin does not restrict the classes allowed when deserializing stored metadata during its media replace-and-update-links routine. This allows the attacker's injected PHP object to be instantiated when a user with upload access performs a routine media replacement operation. This action triggers the vulnerability, leading to PHP Object Injection.
The immediate impact of this PHP Object Injection can include local file inclusion of existing PHP or HTML files. This means an attacker could force the server to execute or display content from files already present on the server. While no known Property Oriented Programming (POP) chain is present within the vulnerable plugin itself, if a POP chain exists via an additional plugin or theme installed on the target system, the vulnerability could escalate. Such an escalation could allow an attacker to delete arbitrary files, retrieve sensitive data, or execute code. Remote code execution is a potential outcome if an attacker-influenced PHP or HTML file is already present on the server and a suitable POP chain is available. This type of vulnerability is assessed as moderately dangerous and has the potential for use in mass-exploit campaigns.
How to detect a compromise
Detecting a compromise related to PHP Object Injection can involve examining several areas of your WordPress installation and server environment. Focus on identifying unusual activity or unexpected changes that align with the potential outcomes of this vulnerability.
Monitor your server access logs and PHP error logs for suspicious entries. Look for unexpected requests to plugin-specific endpoints, especially those related to media replacement functions. Pay attention to PHP warnings or errors that mention deserialization functions like unserialize() or indicate issues with object instantiation, particularly if these occur without a clear legitimate cause.
Perform regular file integrity checks across your WordPress installation. Attackers who achieve local file inclusion or remote code execution may create new files, modify existing ones, or delete critical components. Look for newly created PHP files in unexpected directories (e.g., wp-content/uploads, plugin directories, or the root of your WordPress installation), modifications to core WordPress files or legitimate plugin files, or unusual changes in file permissions. Tools that monitor file changes can assist in this process.
Examine your WordPress database for any unauthorized modifications. While the direct impact of this vulnerability primarily involves file system and code execution, a successful exploit could lead to database manipulation. Check for new or modified user accounts, altered plugin settings, or unusual content entries that you did not create.
If you have shell access to your server, you can use command-line tools to inspect your WordPress installation. To quickly list installed plugins and their versions, which helps in identifying vulnerable components, use WP-CLI:
wp plugin list --field=name,versionThis command provides a concise overview of your plugin landscape. Regularly review your site's security posture, including user accounts, installed plugins, and themes, to identify any unauthorized additions or changes.
How to fix
To address the PHP Object Injection vulnerability in the Enable Media Replace plugin, take the following steps:
Update the Plugin: The primary remediation is to update the Enable Media Replace plugin to version 4.2.3 or higher. This version contains the necessary patch to resolve the deserialization of untrusted input vulnerability.
Log in to your WordPress administration dashboard.
Navigate to "Plugins" -> "Installed Plugins".
Locate "Enable Media Replace" in the list.
If an update is available, a notice will appear below the plugin name. Click "Update Now" to apply the patch.
After updating, verify that the plugin version is 4.2.3 or newer.
Verify Site Functionality: After updating, clear any site caches and verify that all functionalities of your website, especially those related to media management, continue to operate as expected.
Consider Deactivation (If Immediate Update is Not Possible): If you are unable to update the plugin immediately, consider deactivating the Enable Media Replace plugin temporarily. Deactivating the plugin removes the vulnerable code path from execution, mitigating the immediate risk. However, this will disable the plugin's functionality. Re-enable only after updating to a patched version.
Review for Compromise: If your site was running a vulnerable version of the plugin, particularly if it was exposed for an extended period, review your site for any signs of compromise as described in the "How to detect a compromise" section. This includes checking logs, file system integrity, and database entries for unauthorized changes.
Timeline
Date | Event |
|---|---|
2026-10-29 | CVE Published |