Enable Media Replace stores scripts through location_dir
An authenticated Author or higher can supply attacker-controlled content through the location_dir parameter in Enable Media Replace through 4.1.8. Insufficient input sanitization and output escaping allow that content to be stored and later execute as script when a user views an affected page. The endpoint, storage location and exact rendering function are unspecified. Confirmed fixed release: 4.1.9.
- Component
- Enable Media Replace
- Plugin slug
enable-media-replace- Affected
- <= 4.1.8
- Safe version
4.1.9- Published
- Jun 09, 2026
This CVE was published Jun 09, 2026 and is one of 11 known issues for this plugin.
Update, patch or deactivate.
Update to 4.1.9 or later, preferably the current supported release. The official 4.1.9 changelog specifically fixes stored cross-site scripting through location_dir. Validate replacement directory input and escape stored values for their output context; inspect saved replacement settings and affected pages for injected markup. Official changelog: https://wordpress.org/plugins/enable-media-replace/#developers
A safe version is available, so updating to that version or later is the preferred remediation. If an immediate update is not practical, consider a targeted application patch or temporarily restricting the affected functionality.
Deactivate only when warranted by your risk profile, or when advised by your hosting provider in the limited circumstances where the vulnerability cannot otherwise be mitigated. If you’re unsure which action is appropriate, contact Fused or your hosting provider for guidance.
Technical description
The Enable Media Replace plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the ‘location_dir’ parameter in all versions up to, and including, 4.1.8 due to insufficient input sanitization and output escaping. This makes it possible for authenticated attackers, with Author-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.
CVE / CNA vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N