# Stored XSS in the Classic block element path

Author stores entity-encoded XSS in an image's data-wp-more attribute; KSES preserves it and TinyMCE's element-path UI decodes and renders it as HTML when an admin selects the image.

- Payout: hidden
- Severity: none
- Program: WordPress
- Found by: pinkdraconian
- Disclosed: 2026-11-11
- Write-up quality: 7/10
- Original: https://hackerone.com/reports/4100259
- Library page: https://bugbountylibrary.com/r/h1%3A4100259
- Tags: area:web domain:web impact:ato kind:bounty platform:hackerone tech:wordpress technique:incomplete-fix technique:source-review vuln:xss

**Target:** WordPress core editor (TinyMCE Classic block element-path UI)
**Root cause:** KSES allows data-* attributes, so an entity-encoded payload in data-wp-more survives sanitization; the WordPress TinyMCE ResolveName handler copies the decoded attribute into the modern theme's element-path renderer, which inserts it as HTML.
**Steps:**
1. Deploy the pinned dev build (`cp .env.example .env` and `docker compose up -d --build`), install WordPress, create an Author user.
2. As Author, in Code editor create a post with `<p><img src="/wp-includes/images/w-logo-blue-white-bg.png" width="100" data-wp-more="&lt;img src=x onerror=alert(document.domain)&gt;"></p>`
3. Switch to Visual editor and save; content becomes a core/freeform Classic block with the encoded attribute intact.
4. As Administrator, edit the draft, select the Classic block, click Edit, then click the image inside the Classic Editor modal.
5. The decoded data-wp-more value is inserted into element-path HTML; nested img fails and `alert(document.domain)` fires.
**How found:** Noticed the dev commit removed the editor setting that previously disabled the element path (elementpath = false), then traced how data-* attributes survive KSES and flow through ResolveName into the theme's HTML element-path renderer.
**Exploitation:** Author-level user plants the payload in a post; when an Administrator opens the Classic editor modal and selects the image, the element-path UI renders the decoded attribute as HTML, executing script in the admin's session.
**Insight:** When a hardening setting like elementpath=false is removed in a commit, audit every data-* attribute that KSES preserves and trace whether editor UI code decodes and re-inserts it as HTML rather than text.

## Proof of concept (copied exactly from the original report)

**Author payload image with encoded data-wp-more XSS**

```
<p><img src="/wp-includes/images/w-logo-blue-white-bg.png" width="100" data-wp-more="&lt;img src=x onerror=alert(document.domain)&gt;"></p>
```

