<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/tag-names-can-run-javascript-now-and-every-browser-is-affected-yzzircis8" -->

---
title: Tag names can run JavaScript now, and every browser is...
description: Security researcher Gareth Heyes discovered that HTML tag names can be crafted to execute JavaScript across all major browsers, by exploiting how the localName...
canonical: https://daily.dev/posts/tag-names-can-run-javascript-now-and-every-browser-is-affected-yzzircis8
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Tag names can run JavaScript now, and every browser is affected | daily.dev
og:description: Security researcher Gareth Heyes discovered that HTML tag names can be crafted to execute JavaScript across all major browsers, by exploiting how the localName...
og:url: https://daily.dev/posts/tag-names-can-run-javascript-now-and-every-browser-is-affected-yzzircis8
og:image: https://api.daily.dev/og/posts/YZzIrcIs8.png
og:image:alt: Tag names can run JavaScript now, and every browser is affected
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Tag names can run JavaScript now, and every browser is affected

**[Trends](https://daily.dev/sources/trends)** · 2 min read · 2 upvotes · 1 comments

## Summary

Security researcher Gareth Heyes discovered that HTML tag names can be crafted to execute JavaScript across all major browsers, by exploiting how the localName property lowercases unusual characters in tag names and chaining that with onfocus, tabindex, contenteditable, and DOM properties like attributes, part, classList, and setHTMLUnsafe. Because most signature-based WAFs and blocklists only look for JavaScript in conventional places like script tags or onerror attributes, these payloads slip past them undetected. This is not a single-browser bug that can be patched; it stems from fundamental HTML parsing behavior, so sanitizers need to be updated to account for it now. James Kettle, a well-known figure in web security research, retweeted the finding without comment, signaling its significance within the community.

## Content

Gareth Heyes found something that shouldn't work and does: put a JavaScript URL inside an HTML tag name, and browsers will execute it. All of them.

The [full writeup](https://portswigger.net/research/what-s-in-a-tag-name) is worth reading if you do anything security-adjacent. The short version: HTML tag names can contain unusual characters, and the browser's `localName` property returns a lowercased version of whatever's in there. Heyes chains that behavior with `onfocus` events, `tabindex`, `contenteditable`, and DOM properties like `attributes`, `part`, `classList`, and `setHTMLUnsafe` to construct XSS payloads that hide JavaScript inside what looks like a harmless tag name.

The practical problem is WAF bypass. Most signature-based filters aren't looking for JavaScript inside tag names because nobody expected tag names to be executable. These payloads slip through blocklists that would catch conventional `<script>` or `onerror` injection.

This isn't a single browser bug with a patch coming. It's a consequence of how HTML parsing works across the board, which means there's no clean fix to wait for. If you're sanitizing HTML input, your sanitizer needs to account for this now.

James Kettle (albinowax) retweeted it without comment, which in web security circles is basically a five-alarm signal.

The takeaway: tag name parsing is weirder than anyone assumed, every major browser is affected, and WAFs that haven't been updated to account for this are currently blind to it.

## Questions this post answers

### How can an HTML tag name be used to execute JavaScript and bypass a WAF?

HTML tag names can contain unusual characters, and the browser's localName property returns a lowercased version of whatever is inside the tag name. By chaining this with onfocus events, tabindex, contenteditable, and DOM properties like attributes, part, classList, and setHTMLUnsafe, an attacker can construct XSS payloads hidden inside what looks like a harmless tag name, which most signature-based WAFs do not scan for.

_Teams hardening sanitizers against XSS can follow emerging bypass techniques like this one on daily.dev._

### Is the tag-name-based XSS bypass a single browser bug that will get patched?

No, it is not a single browser bug with a fix coming. Every major browser is affected because the issue stems from how HTML parsing itself works, meaning there is no clean patch to wait for. Anyone sanitizing HTML input needs to update their sanitizer to account for this behavior immediately rather than expecting a vendor fix.

_Developers tracking cross-browser security quirks like this can follow updates on daily.dev._

## Community take

How the wider developer community reacted, aggregated from 2 discussions and 10 comments across lobsters, hackernews (as of 2026-08-26).

**TL;DR:** Commenters are intrigued by the cleverness of the technique but debate its practical exploitability, generally agreeing it's more useful for bypassing WAFs/blocklists than as a direct real-world XSS vector, while some fault the writeup for relying on experimentation instead of citing the HTML/DOM specs.

**Sentiment:** 20% positive · 55% mixed · 25% skeptical

**The case for**

- Several found the research neat and appreciated seeing the author's exploration process that led to a minimal, contrived XSS vector.
- Multiple agreed the technique is realistically useful for bypassing WAFs and obscure pattern/blocklist filters.
- One noted that even 'unlikely' tricks can become dangerous once chained with other weaknesses.

**The pushback**

- Some questioned the practical usefulness, doubting a site would ever create elements from untrusted tag names with the needed attributes.
- One critic felt the author should have referenced the HTML/DOM specs directly rather than relying on ad hoc experimentation and fuzzing, since parsing behavior is exhaustively defined and consistent across implementations.
- A commenter initially noted the post didn't specify which browsers were affected before realizing it was addressed in the article.

**By community**

- lobsters (mixed): Discussion mixes appreciation for the cleverness with skepticism about real-world exploitability and criticism that the spec wasn't consulted directly.
- hackernews (mixed): No comment content was provided, so no discernible take could be formed.

**Hottest debate:** Whether this is a genuinely exploitable XSS technique or mostly a fun experimental curiosity with niche WAF-bypass value.

**Open questions**

- Could this technique realistically be chained with other vulnerabilities to form a full exploit in practice?

**Highlights**

> No, I think this is mostly fun and experimental.  Even if you could get someone to create that element, it’s unlikely you could get the required attributes in.  Obscure filters and bad block listing seems like the more realistic scenario.
> — [freddyb on lobsters · 3 points, 1 comments](https://lobste.rs/s/lbsvk7/what_s_tag_name_javascript_apparently#c_vzzkbh)

> I was genuinely disappointed to see “wondering what characters are allowed in a tag” followed by *experimentation* and even *fuzzing* rather than reference to the spec—I would have expected anyone from PortSwigger to know that HTML has a dependable spec, and that *especially* around parsing, all implementations match it exactly (barring new features, like how they just resurrected processing instructions). I know I reach to the HTML Standard quite frequently over subtle details; it’s typically faster and more reliable than experimenting. The [tag open state](https://html.spec.whatwg.org/multipage/parsing.html#tag-open-state) shows that the tag name has to start with ASCII alpha, and then the [tag name state](https://html.spec.whatwg.org/multipage/parsing.html#tag-name-state) shows that *anything* goes other than ␉, ␊, ␌, ␠, /, > and ␀, with ASCII uppercase immediately lowercased. So `<alert(1)>` is considered legal syntax, no parse error or such (though a validator will probably still complain that there’s no such element). Related fun stuff: at unspecified times and browsers in history (but long ago, and not consistent across browsers), `<br/>` would create an element with local name `br/` (which was why `<br />` became the XHTML/HTML-polyglot way of writing a line break, found in many CMSes; whereas XML would customarily skip the space), and `<br />` would create an element with local name `br` and one attribute named `/` with value empty string (and I honestly think they should have left it that way rather than ignoring a trailing slash—now we’ve somehow ended up with a whole lot of developers that think the `/` *does* something or is in any way worthwhile).
> — [chrismorgan on lobsters · 1 points](https://lobste.rs/s/lbsvk7/what_s_tag_name_javascript_apparently#c_en5tsv)

> It's always weird and unlikely... until someone chains it with another weird thing for a full exploit ;)
> — [viraptor on lobsters · 3 points](https://lobste.rs/s/lbsvk7/what_s_tag_name_javascript_apparently#c_aa5hvb)

> Fascinating how the end result looks so simple and clearly minimal. I like how Gareth describes how he started, which avenues he explored and how he arrived at this contrived but tiny XSS vector. Just neat.
> — [freddyb on lobsters · 1 points](https://lobste.rs/s/lbsvk7/what_s_tag_name_javascript_apparently#c_lj8psf)

**Source threads**

- [lobsters](https://lobste.rs/s/lbsvk7/what_s_tag_name_javascript_apparently) · 10 points · 10 comments
- [hackernews](https://news.ycombinator.com/item?id=49448520) · 3 points · 0 comments

## Community discussion

Top comments from developers on daily.dev.

**@petermrozek** · 2 upvotes

> Link to the article, as it might've changed since this trend summary was generated: [https://portswigger.net/research/whats-in-a-tag-name-javascript-apparently?via=dailydev](https://portswigger.net/research/whats-in-a-tag-name-javascript-apparently?via=dailydev)
>
> This is kind of crazy. Using HTML tag names as a transport for malicious code - that's a new one. If you're into JavaScript, the first example will already send some very strong signals to your brain. 😉
>
> Then again, any attempt of communication outside the page should still be caught by well designed Content Security Policy rules,...

## Similar posts on daily.dev

- [Finding XSS Through HTML Injection — Without Fuzzing Tools](https://daily.dev/posts/finding-xss-through-html-injection-without-fuzzing-tools-c7q1ohdej) · InfoSec Write-ups · 0 upvotes · 0 comments
- [Secure coding in JavaScript](https://daily.dev/posts/secure-coding-in-javascript-ih44s1aff) · Stack Overflow Blog · 5 upvotes · 0 comments

---

Tags: [#security](https://daily.dev/tags/security), [#web-security](https://daily.dev/tags/web-security)

[View this post on daily.dev](https://daily.dev/posts/tag-names-can-run-javascript-now-and-every-browser-is-affected-yzzircis8)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Tag names can run JavaScript now, and every browser is affected","url":"https://daily.dev/posts/tag-names-can-run-javascript-now-and-every-browser-is-affected-yzzircis8","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/tag-names-can-run-javascript-now-and-every-browser-is-affected-yzzircis8"},"datePublished":"2026-08-26T18:38:23.671Z","dateModified":"2026-08-26T18:39:04.204Z","description":"Security researcher Gareth Heyes discovered that HTML tag names can be crafted to execute JavaScript across all major browsers, by exploiting how the localName...","isAccessibleForFree":true,"articleSection":"Trends","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Trends","logo":"https://media.daily.dev/image/upload/s--ZfSp3asX--/f_auto,q_auto/v1780996004/logos/trends?_a=BAMAMiWQ0","url":"https://daily.dev/sources/trends"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/tag-names-can-run-javascript-now-and-every-browser-is-affected-yzzircis8","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"security,web-security","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Trends","item":"https://daily.dev/sources/trends"},{"@type":"ListItem","position":3,"name":"Tag names can run JavaScript now, and every browser is affected"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/tag-names-can-run-javascript-now-and-every-browser-is-affected-yzzircis8","comment":[{"@type":"Comment","text":"Link to the article, as it might’ve changed since this trend summary was generated: https://portswigger.net/research/whats-in-a-tag-name-javascript-apparently?via=dailydev\nThis is kind of crazy. Using HTML tag names as a transport for malicious code - that’s a new one. If you’re into JavaScript, the first example will already send some very strong signals to your brain. 😉\nThen again, any attempt of communication outside the page should still be caught by well designed Content Security Policy rules, so please don’t rely only on sanitising.","datePublished":"2026-08-27T06:10:59.991Z","url":"https://daily.dev/posts/YZzIrcIs8#c-Yz709ySiN","author":{"@type":"Person","name":"Peter Mrożek","url":"https://daily.dev/petermrozek","image":"https://media.daily.dev/image/upload/s--pBfYX68K--/f_auto/v1769247960/avatars/avatar_Qz65P1nVw3Bu6C5YwaZgA?_a=BAMAMiiu0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/tag-names-can-run-javascript-now-and-every-browser-is-affected-yzzircis8#faq","mainEntity":[{"@type":"Question","name":"How can an HTML tag name be used to execute JavaScript and bypass a WAF?","acceptedAnswer":{"@type":"Answer","text":"HTML tag names can contain unusual characters, and the browser's localName property returns a lowercased version of whatever is inside the tag name. By chaining this with onfocus events, tabindex, contenteditable, and DOM properties like attributes, part, classList, and setHTMLUnsafe, an attacker can construct XSS payloads hidden inside what looks like a harmless tag name, which most signature-based WAFs do not scan for. Teams hardening sanitizers against XSS can follow emerging bypass techniques like this one on daily.dev."}},{"@type":"Question","name":"Is the tag-name-based XSS bypass a single browser bug that will get patched?","acceptedAnswer":{"@type":"Answer","text":"No, it is not a single browser bug with a fix coming. Every major browser is affected because the issue stems from how HTML parsing itself works, meaning there is no clean patch to wait for. Anyone sanitizing HTML input needs to update their sanitizer to account for this behavior immediately rather than expecting a vendor fix. Developers tracking cross-browser security quirks like this can follow updates on daily.dev."}}]}
```

