# Custom Related Posts <= 1.8.3 - Authenticated (Administrator+) Stored Cross-Site Scripting via Custom Layout Template

- **ID:** WPSEC-2026-4588
- **Plugin:** Custom Related Posts (`custom-related-posts`), https://wordpress.org/plugins/custom-related-posts/
- **Affected versions:** from 1.8.0 before 1.8.4
- **Fixed in:** 1.8.4 (Update to 1.8.4 or later.)
- **Severity:** Medium 4.4 (CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:L/I:L/A:N)
- **Weakness:** CWE-79
- **Usage among sites WPSec scans:** plugin Medium, affected versions Low (as of 2026-12-04)
- **Attack surface analysis:** https://attacksurface.wpsec.com/plugin/custom-related-posts
- **Fix released:** 2026-12-03
- **Published:** 2026-12-04
- **URL:** https://wpsec.com/vuln/WPSEC-2026-4588/

## Description

The Custom Related Posts plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the custom layout template in versions 1.8.0 up to, and including, 1.8.3. The template is filtered with wp_kses_post() when it is saved, but it is then split into lines and each line is output separately, so a tag or attribute value spanning several lines passes the filter as harmless text and becomes markup after the split. This makes it possible for authenticated attackers, with administrator-level access and above, to inject arbitrary web scripts in pages that display related posts. This only affects multi-site installations and installations where unfiltered_html has been disabled.

## References

- https://wpsec.com/vuln/WPSEC-2026-4588/
- https://plugins.svn.wordpress.org/custom-related-posts/tags/1.8.4/
- https://wordpress.org/plugins/custom-related-posts/

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

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.
