# LuckyWP Table of Contents <= 2.1.14 - Authenticated (Contributor+) Stored Cross-Site Scripting via Heading-Derived Anchor IDs

- **ID:** WPSEC-2026-4184
- **Plugin:** LuckyWP Table of Contents (`luckywp-table-of-contents`), https://wordpress.org/plugins/luckywp-table-of-contents/
- **Affected versions:** from 1.9.10 before 2.1.15
- **Fixed in:** 2.1.15 (Update to 2.1.15 or later.)
- **Severity:** Medium 4.9 (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/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/luckywp-table-of-contents
- **Fix released:** 2026-11-27
- **Published:** 2026-11-28
- **URL:** https://wpsec.com/vuln/WPSEC-2026-4184/

## Description

The LuckyWP Table of Contents plugin for WordPress is vulnerable to Stored Cross-Site Scripting via heading-derived anchor IDs in all versions up to, and including, 2.1.14. This is due to insufficient sanitization of anchor IDs generated from heading text when the "As heading without transliterate" hash format is used, combined with missing output escaping of those IDs in the href attribute of table of contents links. This makes it possible for authenticated attackers, with contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page, provided the non-default hash format is enabled.

## References

- https://wpsec.com/vuln/WPSEC-2026-4184/
- https://plugins.svn.wordpress.org/luckywp-table-of-contents/tags/2.1.15/
- https://wordpress.org/plugins/luckywp-table-of-contents/

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

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.
