# CP Related Posts <= 1.2.0 - Authenticated (Contributor+) Stored Cross-Site Scripting via Recommended Tags

- **ID:** WPSEC-2026-4216
- **Plugin:** CP Related Posts (`cp-related-posts`), https://wordpress.org/plugins/cp-related-posts/
- **Affected versions:** all versions before 1.3.0
- **Fixed in:** 1.3.0 (Update to 1.3.0 or later.)
- **Severity:** Medium 5.4 (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N)
- **Weakness:** CWE-79
- **Usage among sites WPSec scans:** plugin Low, affected versions Low (as of 2026-11-28)
- **Attack surface analysis:** https://attacksurface.wpsec.com/plugin/cp-related-posts
- **Fix released:** 2026-11-28
- **Published:** 2026-11-29
- **URL:** https://wpsec.com/vuln/WPSEC-2026-4216/

## Description

The CP Related Posts plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the recommended tags in the post editor's related posts meta box in all versions up to, and including, 1.2.0, due to the admin script building HTML by string concatenation from the tag names returned by the extract-tags request and inserting it with jQuery's .html() without escaping. Tag names are extracted from the stored post title and content after HTML entities are decoded, and quote characters inside words are kept. This makes it possible for authenticated attackers, with Contributor-level access and above, to inject arbitrary web scripts that execute when a higher-privileged user edits the attacker's post and requests the recommended tags.

## References

- https://wpsec.com/vuln/WPSEC-2026-4216/
- https://plugins.svn.wordpress.org/cp-related-posts/tags/1.3.0/
- https://wordpress.org/plugins/cp-related-posts/

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

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.
