Published: Wednesday, 18 November 2026 at 14:39 UTC
Updated: Wednesday, 18 November 2026 at 14:39 UTC

Introduction
I’m delighted to introduce Masato Kinugawa as a guest web security researcher on the PortSwigger research channel. Masato is a well known web security expert who has found countless high impact bugs and amazingly he solved one of our “impossible” labs. We took this chance to invite him to do a guest post, over to you Masato…
In 2020, Gareth Heyes compiled a list of
impossible labs
, covering various injection scenarios where JavaScript execution was considered impossible.
One of the challenges on this list, “innerHTML context but no equals allowed”, asks whether arbitrary JavaScript can be executed when an injection occurs in innerHTML but the equals sign is not allowed. This challenge had long been considered impossible.
Recently, I discovered a way to solve this challenge using a newly introduced HTML element. Here is the payload:
`;
]]>
Although this payload no longer works in Chrome due to a behavior change introduced in Chrome 153, I have confirmed that it still works in Safari 27.2, the latest version at the time of writing.
In this article, I’ll share the story behind this discovery and explore the technical details behind it.
The starting point
In May 2026, a very interesting
DOMPurify bypass
discovered by
Kabir Acharya
was disclosed.
What surprised me about this technique was its use of the
element, which was relatively recently introduced in Chrome and Safari and which I had never seen used in an XSS vector before. For details of the bypass, see
“Attack Classes & Bypass History” in the DOMPurify wiki
.
Despite its seemingly harmless name, the
element has a unique capability.
Let’s take a look at the following HTML:
When this HTML is placed on a page, inspecting the resulting DOM using
innerHTML reveals the following:
Surprisingly, the contents of option 2 have been copied into
, including the HTML elements.
This element has the ability to clone the child nodes of the currently selected
element. In this example, option 2 is selected by default because it has the
selected attribute, so its contents are cloned.
Previously, no HTML element could perform this kind of cloning operation on its own without executing JavaScript. Inspired by Kabir’s discovery, I wondered whether this behavior could make other previously impossible things possible, so I began investigating.
Building an XSS vector
Before investigating the
innerHTML case, I discovered that JavaScript could be executed through the following HTML:
In this example, the HTML document ends immediately after . When this HTML is opened in Chrome or Safari, an alert is triggered exactly once.
What makes this behavior interesting is that, normally, when an unclosed
tag reaches the end of the document without an explicit closing tag(),the script is not executed.In this case,however,the script executes without a closing tag.What is happening here?In aelement,the firstis selected by default if no
selected
attribute is specified.Therefore,in this case,thecontaining theelement is selected,and the browser clones its child nodes and inserts them into.In this process,the Chrome and Safari implementations execute the clonedelement.We can confirm that it is the cloned element that executes by replacingalert(1)withalert(document.currentScript.parentNode.tagName),which returnsSELECTEDCONTENTas the tag name of the executing script’s parent element.
Making the vector more useful
After I shared this vector on social media,with the help of Mathias Karlsson,we managed to eliminate“https://portswigger.net/”entirely from the vector.This allowed JavaScript to execute without using whitespace, “https://portswigger.net/”, or ”
=
“. (The line breaks in the payload are only for readability and can be removed.)
Although reducing the number of distinct characters required is interesting, this vector has a significant limitation. If additional content follows the vector, it becomes part of the
block, making a JavaScript syntax error highly likely. This severely limits the vector’s usefulness in real-world XSS scenarios.
Fortunately, this problem can be solved by using SVG.

