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

High 7.5 CWE-502Fixed in 5.0.0
ID
WPSEC-2026-4138
Plugin
Enable Media Replace (enable-media-replace)
Affected
from 3.5.0 before 5.0.0
Remediation
Update to 5.0.0 or later.
CVSS 3.1
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-502
Usage
Plugin Medium · Affected versions Medium among sites WPSec scans, 2026-11-27
Attack surface
Enable Media Replace on WPSec AttackSurface
Fix released
Published

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

Published by WPSec. Provided as is, without warranty. Corrections: contact us.

This advisory as JSON, OSV or Markdown · All advisories: JSON, OSV, RSS

License: CC BY 4.0