Skip to content
XSS Advisory Advanced CVE-2025-8582

Insufficient validation of untrusted input in DOM (CVE-2025-8582)

All-ASCII HTML can be autodetected as ISO-2022-JP, causing ASCII content that does not look like markup to be treated as active content. This may lead to XSS if a site serves user-supplied content without declaring its character encoding and filters markup instead of escaping less-than signs.

Anonymous Follow

Originally disclosed on Chrome VRP

Bounty$1,000 Low View original
  • Fix shipped in 7.8 years

VULNERABILITY DETAILS

All-ASCII HTML can get autodetected as ISO-2022-JP, which makes ASCII content that doesn't look like markup treated as active content. This may lead to XSS if the site serves user-supplied content.

As a mitigating factor, to be vulnerable a site has to violate two best practices:

  1. The site needs not to declare its character encoding. (Pretty realistic, unfortunately.)
  2. Instead of escaping all less-than signs in user-supplied content as would be proper, the site needs to try to filter out markup specifically. (The proof of concept includes an ASCII less-than sign byte followed by a non-alphabetic byte, so there's a chance there are filter out there that wouldn't consider it as matching a regexp for an HTML tag.)

However, from the work I've seen Mike West do, I have inferred that Chrome considers these kinds of site mistakes to be in scope for browser-based counter-measures.

As a remedy, I suggest excluding ISO-2022-JP from potential autodetection outcomes.

VERSION Google Chrome 62.0.3202.75 (Official Build) (64-bit) Revision 67b212ffb03c4401235f8961e2d15371b96cde27-refs/branch-heads/3202@{#750} OS Ubuntu 16.04

REPRODUCTION CASE Load https://hsivonen.com/test/p/iso-2022-jp-autodetect.htm in Chrome.

ADDITIONAL INFO For bug unhiding, coordination with unhiding https://bugzilla.mozilla.org/show_bug.cgi?id=1362365 would be appreciated.

The original report as published on the Chromium issue tracker, by Anonymous. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

The target here is Google Chrome's character encoding autodetection, the mechanism that decides which encoding to use for a page when the server does not declare one. The report concerns the interaction between that autodetection and the HTML parser: if a page is all ASCII but Chrome guesses ISO-2022-JP, then ASCII bytes that do not look like markup can be interpreted as active content. The weakness is classified as insufficient validation of untrusted input in the DOM, and the report frames the outcome as a possible cross-site scripting issue on sites that serve user-supplied content.

The report is an advisory-style disclosure from the Chrome VRP, credited to an anonymous researcher, rated low severity, with a bounty of 1000.00 USD and disclosed on 2025-08-05.

Setup

The researcher reproduced the behaviour on a desktop Chrome build with the following version details:

Item Value
Google Chrome 62.0.3202.75 (Official Build) (64-bit)
Revision [redacted]-refs/branch-heads/3202@{#750}
OS Ubuntu 16.04

No accounts, roles or special tooling are involved. The precondition is a page that is all ASCII, that does not declare its character encoding, and that serves user-supplied content.

Finding it

The researcher noticed that all-ASCII HTML can be autodetected as ISO-2022-JP. When that happens, ASCII content that does not look like markup is treated as active content. The concern is that this can lead to XSS if the site serves user-supplied content.

The report is explicit that two site-side mistakes have to coincide for a site to be vulnerable:

  1. The site does not declare its character encoding. The researcher calls this pretty realistic.
  2. Instead of escaping all less-than signs in user-supplied content, as would be proper, the site tries to filter out markup specifically. The proof of concept includes an ASCII less-than sign byte followed by a non-alphabetic byte, so there is a chance that some filters would not consider it as matching a regular expression for an HTML tag.

The researcher also notes a policy point: from work seen from Mike West, the researcher inferred that Chrome considers these kinds of site mistakes to be in scope for browser-based counter-measures. That inference is what justifies treating a site misconfiguration as a browser bug.

Exploitation

Step 1: load the test page

The reproduction is a single step. Load the following URL in Chrome:

Text
https://hsivonen.com/test/p/iso-2022-jp-autodetect.htm

The report gives only the URL and states that loading it in Chrome demonstrates the behaviour. Under that encoding, the ASCII content that does not look like markup is interpreted as active content rather than as inert text. The report does not include the page source, the exact bytes used, or the resulting browser output; it only states that loading the page in Chrome demonstrates the behaviour.

The proof of concept includes an ASCII less-than sign byte followed by a non-alphabetic byte, so some filters may not treat it as matching an HTML tag pattern.

Root cause

The root cause is that ISO-2022-JP is among the possible outcomes of encoding autodetection for all-ASCII input. Because the input is pure ASCII, a site author reasonably assumes that ASCII-only content cannot change meaning. Once the browser guesses ISO-2022-JP, ASCII content that does not look like markup is treated as active content.

The existing defences do not stop this. Declaring the encoding would prevent autodetection entirely, but the vulnerable site does not do that. Escaping every less-than sign would neutralise the payload regardless of the guessed encoding, but the vulnerable site instead filters markup, and the site filters markup, and there is a chance some filters would not consider the sequence as matching an HTML tag pattern. The report presents both of these as site-side mistakes that must coincide; the browser-side issue is the autodetection outcome itself.

Impact

If a site meets both conditions, this may lead to XSS. because ASCII content that does not look like markup is treated as active content under the autodetected ISO-2022-JP encoding. The report hedges this as a possible XSS ("may lead to XSS") and stresses that the site has to violate the two best practices described above. The severity recorded for the report is low.

Fix

The researcher's suggested remedy is to exclude ISO-2022-JP from potential autodetection outcomes. The report does not state whether or how Chrome implemented that suggestion.

Variants to test

  • Serve all-ASCII user content from a page with no declared encoding and check whether the browser autodetects a non-ASCII-compatible encoding. A positive result is the browser choosing an encoding under which the supplied bytes are reinterpreted as active content.
  • Submit a less-than sign followed by a non-alphabetic byte through a filter that blocks HTML tags. A positive result is the filter passing the sequence while the browser still treats it as markup under the autodetected encoding.
  • Test other legacy encodings that can be autodetected for ASCII input, in the same no-declared-encoding setup. A positive result is any encoding where plain ASCII bytes change meaning after autodetection.

Hunting notes

This kind of bug hides where servers omit the charset declaration and where user content is filtered rather than escaped. During recon, the signals are responses without a declared character encoding and input handling that strips or blocks tag-like patterns instead of encoding less-than signs. The researcher showed impact by pointing to a test page to load in Chrome and by arguing, from prior Chrome work, that site mistakes of this kind are in scope for browser counter-measures; the report does not describe any further impact demonstration.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 8 min read.

What happened, in plain words

A security researcher reported that all-ASCII HTML can be autodetected as ISO-2022-JP by Google Chrome. Chrome sometimes has to guess which character encoding a page uses, because the page does not say. Character encoding is the set of rules that turns the bytes stored in a file into letters and symbols on your screen. If Chrome guesses ISO-2022-JP, ASCII content that does not look like markup is treated as active content, which may lead to XSS if the site serves user-supplied content.

The researcher showed this by loading a test page in Chrome. The report is rated low severity, was paid a bounty of 1000.00 USD, and was disclosed on 2025-08-05. The researcher is anonymous.

Context

The product involved is Google Chrome, specifically the part that guesses a page's character encoding when the website does not tell the browser which one to use. This guessing is called autodetection. The report is about how that guessing interacts with the HTML parser, the part of the browser that reads the page and decides what is text and what is markup (tags like <b> or <script>).

The weakness is classified as insufficient validation of untrusted input in the DOM. The DOM (Document Object Model) is the browser's in-memory model of the page, the tree of elements that scripts can read and change. "Untrusted input" means anything a user or an attacker can supply, such as a comment on a forum. "Insufficient validation" means the browser does not check that input carefully enough before acting on it.

The report is an advisory-style disclosure from the Chrome VRP (Vulnerability Reward Program, Google's bug bounty programme for Chrome). It is credited to an anonymous researcher, rated low severity, with a bounty of 1000.00 USD, and disclosed on 2025-08-05.

Setup

The researcher reproduced the behaviour on a desktop Chrome build with these version details:

Item Value
Google Chrome 62.0.3202.75 (Official Build) (64-bit)
Revision [redacted]-refs/branch-heads/3202@{#750}
OS Ubuntu 16.04

No accounts, roles or special tooling are involved. The precondition is a page that is all ASCII, that does not declare its character encoding, and that serves user-supplied content. ASCII is the basic set of 128 characters that includes the English letters, digits, punctuation and control codes; an all-ASCII page contains nothing outside that set. "Declaring the encoding" means the website tells the browser, usually in an HTTP header or a <meta> tag, which encoding to use, so the browser does not have to guess.

Finding it

The researcher noticed that all-ASCII HTML can be autodetected as ISO-2022-JP. When that happens, ASCII content that does not look like markup is treated as active content. The concern is that this can lead to XSS if the site serves user-supplied content.

The report is explicit that two site-side mistakes have to coincide for a site to be vulnerable:

  1. The site does not declare its character encoding. The researcher calls this pretty realistic.
  2. Instead of escaping all less-than signs in user-supplied content, as would be proper, the site tries to filter out markup specifically. The proof of concept includes an ASCII less-than sign byte followed by a non-alphabetic byte, so there is a chance that some filters would not consider it as matching a regular expression for an HTML tag.

Escaping means turning a character that has special meaning into a harmless representation, for example turning < into &lt;. Filtering means trying to detect and remove dangerous patterns instead. A regular expression is a pattern-matching language used to describe text, such as "a less-than sign followed by a letter".

The researcher also notes a policy point: from work seen from Mike West, the researcher inferred that Chrome considers these kinds of site mistakes to be in scope for browser-based counter-measures. That inference is what justifies treating a site misconfiguration as a browser bug. In other words, even though the website made mistakes, the browser is expected to protect users against them.

Exploitation

Step 1: load the test page

The reproduction is a single step. Load the following URL in Chrome:

Text
https://hsivonen.com/test/p/iso-2022-jp-autodetect.htm

This is a web address. Typing it into Chrome's address bar and pressing Enter asks the browser to fetch that page from the server hsivonen.com and display it. The report gives only the URL and states that loading it in Chrome demonstrates the behaviour. Under that encoding, the ASCII content that does not look like markup is interpreted as active content rather than as inert text. The report does not include the page source, the exact bytes used, or the resulting browser output; it only states that loading the page in Chrome demonstrates the behaviour.

The proof of concept includes an ASCII less-than sign byte followed by a non-alphabetic byte, so some filters may not treat it as matching an HTML tag pattern. A byte is one unit of data, usually one number from 0 to 255; the less-than sign < is one such byte. A non-alphabetic byte is anything that is not a letter, such as a digit or punctuation.

Root cause

The root cause is that ISO-2022-JP is among the possible outcomes of encoding autodetection for all-ASCII input. Because the input is pure ASCII, a site author reasonably assumes that ASCII-only content cannot change meaning. Once the browser guesses ISO-2022-JP, ASCII content that does not look like markup is treated as active content. An escape sequence is a short sequence of bytes that tells the decoder to switch to a different set of characters, like a secret code that changes the meaning of what follows.

The existing defences do not stop this. Declaring the encoding would prevent autodetection entirely, but the vulnerable site does not do that. Escaping every less-than sign would neutralise the payload regardless of the guessed encoding, but the vulnerable site instead filters markup, and the site filters markup, and there is a chance some filters would not consider the sequence as matching an HTML tag pattern. The report presents both of these as site-side mistakes that must coincide; the browser-side issue is the autodetection outcome itself.

Impact

If a site meets both conditions, this may lead to XSS. because ASCII content that does not look like markup is treated as active content under the autodetected ISO-2022-JP encoding. The report hedges this as a possible XSS ("may lead to XSS") and stresses that the site has to violate the two best practices described above. The severity recorded for the report is low.

Fix

The researcher's suggested remedy is to exclude ISO-2022-JP from potential autodetection outcomes. The report does not state whether or how Chrome implemented that suggestion.

Variants to test

  • Serve all-ASCII user content from a page with no declared encoding and check whether the browser autodetects a non-ASCII-compatible encoding. A positive result is the browser choosing an encoding under which the supplied bytes are reinterpreted as active content.
  • Submit a less-than sign followed by a non-alphabetic byte through a filter that blocks HTML tags. A positive result is the filter passing the sequence while the browser still treats it as markup under the autodetected encoding.
  • Test other legacy encodings that can be autodetected for ASCII input, in the same no-declared-encoding setup. A positive result is any encoding where plain ASCII bytes change meaning after autodetection.

Hunting notes

This kind of bug hides where servers omit the charset declaration and where user content is filtered rather than escaped. During recon, the signals are responses without a declared character encoding and input handling that strips or blocks tag-like patterns instead of encoding less-than signs. The researcher showed impact by pointing to a test page to load in Chrome and by arguing, from prior Chrome work, that site mistakes of this kind are in scope for browser counter-measures; the report does not describe any further impact demonstration.

Glossary

  • ASCII: the basic set of 128 characters (English letters, digits, punctuation and control codes) that most computers use; an all-ASCII page contains nothing outside that set.
  • Autodetection: the browser guessing which character encoding a page uses when the page does not declare one.
  • Character encoding: the rules that map bytes to characters, so the browser knows how to turn stored data into readable text.
  • ISO-2022-JP: a Japanese character encoding that uses escape sequences to switch between character sets.
  • HTML parser: the part of the browser that reads the page and decides what is text and what is markup.
  • Markup: tags and other syntax in HTML that tell the browser how to structure or display content.
  • DOM (Document Object Model): the browser's in-memory tree of elements that scripts can read and change.
  • Untrusted input: data supplied by users or attackers that the application cannot trust.
  • Validation: checking that input meets expected rules before using it.
  • Cross-site scripting (XSS): a vulnerability where an attacker gets their own script to run in another user's browser in the context of a website.
  • Chrome VRP: Google Chrome's Vulnerability Reward Program, a bug bounty programme that pays for security reports.
  • Bounty: the money paid to a researcher for a valid security report.
  • Severity: a rating of how serious a vulnerability is, often low, medium, high or critical.
  • Escaping: turning a character with special meaning into a harmless representation, such as < into &lt;.
  • Filtering: trying to detect and remove dangerous patterns from input.
  • Regular expression: a pattern-matching language for describing text, such as "a less-than sign followed by a letter".
  • Byte: one unit of data, usually a number from 0 to 255.
  • Escape sequence: a short sequence of bytes that tells the decoder to switch to a different set of characters.
  • Proof of concept (PoC): a minimal demonstration that a vulnerability exists.
  • Recon: the information-gathering phase of security testing.
  • Charset declaration: a statement in an HTTP header or <meta> tag that tells the browser which encoding to use.

More by Anonymous

View all

2,270 more disclosed reports, best first.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.