Image: portswigger.net · rights & removal
What's in a tag name? JavaScript, apparently
Reporting by PortSwigger ResearchRead the original at portswigger.net
Executive Summary
Facts Only
* The user investigated allowed characters in HTML tag names, noting they must begin with "a-zA-Z".
* Inspection of the `localName` property revealed a lowercase version of the tag name.
* The method of chaining the `onfocus` event with itself was explored.
* A string value from `attributes[0].value` could be converted into a function using the `new` operator.
* Fuzzing of tag names showed that alphabetic characters, forward slashes, whitespace, and newlines were transformed during mutation.
* Line and paragraph separator characters did not transform as standard JavaScript newlines.
* An opening angle bracket could be included in a tag name to combine with attributes for XSS vectors.
* The `part` attribute was tested, which converts space-separated values into an array, allowing payload injection via the `onfocus(event)` portion of the event handler.
* Using `contenteditable` was discovered as an alternative method to make an element focusable.
* The function `getAttributeNode` and `setHTMLUnsafe` were noted as relevant functions.
* A variant using `classList` was found as an alternative to the `part` attribute vector.
Full Take
From the original · PortSwigger Research
Published: Tuesday, 25 August 2026 at 14:24 UTC Updated: Tuesday, 25 August 2026 at 14:24 UTC I was on my laptop, as I often am when there's rubbish on telly, and found myself wondering what characters are allowed in a tag. I knew they had to begin with "a-zA-Z", but what about after that?Read the full story at portswigger.net
Sentinel — Human
This appears to be a human-written exploration documenting a personal technical experiment regarding HTML/JavaScript manipulation, characterized by a highly engaged, step-by-step narrative style.
