# Enable Media Replace <= 4.2.3 - Authenticated (Author+) PHP Object Injection via Media Replacement Link Update

- **ID:** WPSEC-2026-4138
- **Plugin:** Enable Media Replace (`enable-media-replace`), https://wordpress.org/plugins/enable-media-replace/
- **Affected versions:** from 3.5.0 before 5.0.0
- **Fixed in:** 5.0.0 (Update to 5.0.0 or later.)
- **Severity:** High 7.5 (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H)
- **Weakness:** CWE-502
- **Usage among sites WPSec scans:** plugin Medium, affected versions Medium (as of 2026-11-27)
- **Attack surface analysis:** https://attacksurface.wpsec.com/plugin/enable-media-replace
- **Fix released:** 2026-11-26
- **Published:** 2026-11-27
- **URL:** https://wpsec.com/vuln/WPSEC-2026-4138/

## Description

The Enable Media Replace plugin for WordPress is vulnerable to PHP Object Injection via the database link update that runs after a media file is replaced in all versions from 3.5.0 up to, and including, 4.2.3. This is due to the replacer removing one layer of serialization from matching meta and option values without adding it back: a string that WordPress stored serialized (for example a custom field whose text is itself a serialized object) was written back to the database as the raw inner string with a direct SQL UPDATE. WordPress later unserializes that value with no class restrictions when it is read. This makes it possible for authenticated attackers with Author-level access and above to inject a PHP object by adding such a custom field to their own post and then replacing a media file whose URL the field contains. No known POP chain is present in the plugin itself. If a POP chain is present through another plugin or theme installed on the target system, it could allow the attacker to delete arbitrary files, retrieve sensitive data, or execute code.

## References

- https://wpsec.com/vuln/WPSEC-2026-4138/
- https://plugins.svn.wordpress.org/enable-media-replace/tags/5.0.0/
- https://wordpress.org/plugins/enable-media-replace/

Source: WPSec, https://wpsec.com/vuln/WPSEC-2026-4138/

License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Free to use, share and adapt, also commercially, if you credit WPSec and link to this advisory.
