Skip to content
Info disclosure Advisory Advanced CVE-2026-13790

Side-channel information leakage in Scroll (CVE-2026-13790)

A side-channel in Chromium's Scroll To Text Fragment (STTF) feature allows an attacker to detect whether a guessed text fragment exists on a cross-origin page by measuring timing differences. By using many text fragments to slow the search and observing history length, an attacker can exfiltrate text character by character.

Vsevolod Kokorin Follow

Originally disclosed on Chrome VRP

Bounty$10,000 High View original
  • Fix shipped in 8 months

Steps to reproduce the problem

Steps to reproduce:

  1. Download attached files
  2. Change TARGET, PREFIX, FOUND, NOT_FOUND if you want to test on another text/website.
  3. Host this files on localhost/site
  4. open exploit_chrome.html
  5. Start typing text

You will see that symbols will gradually start appearing on the page. See example in PoC.mov.

Problem Description

We have discovered that using STTF (Scroll To Text Fragment) makes it possible to detect and exfiltrate text from another page. This is possible due to several factors:

Bypass of Empty BCG check

Firstly, by default, Chromium does not allow the use of STTF if there are other windows in the current Browser Context Group and our page is cross-origin. This check can be found in CheckSecurityResrictions:

C++
    if (frame.GetPage()->RelatedPages().size()) {
      TRACE_EVENT_INSTANT("blink", "CheckSecurityRestrictions", "Result",
                          "Non-Empty Browsing Context Group");
      return false;
    }

This check can be bypassed as follows:

JavaScript
window.location.href=`https://cross-origin-site/#:~:text=...`
window.open('/same-origin-with-attacker')

Based on my tests, this happens because the check of frame.GetPage()->RelatedPages().size() occurs during the redirect, and only after that does the new window begin to open.

Time difference

We discovered that when Chromium opens a link with an STTF, redirects may fail to execute if the text search is under heavy load. This happens because:

  1. First, the text is searched using void TextAnnotationSelector::FindRange, which performs a linear search for text.

  2. When the text is found (even partially), bool IsWordBounded and other checks are performed.

  3. Only after these steps does the highlight and scroll to text occur.

It can be observed that the number of instructions executed will differ, but for a simple search, the difference is negligible.

Therefore, we used another STTF feature to increase the number of instructions and thus slow down the search time — :~:text=...&text=...&text=...&text=....... Since STTF allows us to insert an unlimited number of text fragments, we can add tens of thousands of identical text fragments in a single URL. This slows execution down, as the operation will be performed tens of thousands of times instead of just once.

Detect time difference by history length

There is no traditional way to detect STTF time. However, we have discovered a way to do this:

JavaScript
let w = window.opener
await sleep(TIME);
w.location = TARGET + "#1";
...
w.location = TARGET + "#5";
w.location = 'about:blank'
            
while(true){
    try{
        w.origin;
        ...
        if (w.history.length - previous_history_length==2){
            ... Triggered match
        }
    }catch(e){
        await sleep(100);
    }
}

We found that while STTF is being processed, the redirect process is blocked, and if we choose the correct timing, only the last redirect to about:blank will execute immediately. At this point, we can detect how many redirects actually occurred using history.length.

If sleep(TIME) ends before the STTF finishes, we get 2. Otherwise, we get a higher value. So, to guess the correct value, we need to choose a timing where we consistently get 2 only for the correct prefix.

Timing estimate

Since each user will have different loading times (due to varying internet connections, OS, etc.), I had to implement dynamic timing detection directly in the exploit on the client side.

How it works: Suppose we have a page that contains the text:

Your code: 21346375

So, you need to highlight the text fragment with FOUND='Your cod' and NOT_FOUND='Your coA' (that is, a valid and an invalid prefix before the target text you want to find; it's also important that neither triggers the boundary check).

After that, I use a binary search to find the appropriate timing.

I simply run the test with the current timing on both the FOUND and NOT_FOUND strings:

  1. If the function succeeds for both strings, I decrease the upper bound (we are waiting too long)
  2. If the function finds only one result and it is FOUND, I increase the lower bound
  3. I repeat this with (MIN_TIME + MAX_TIME) / 2

When the difference between the upper and lower bounds is minimal (in my tests, this difference was 100 milliseconds), I stop the search — we have found the timing.

Tested

This exploit was tested by us on 3 different devices in different internet networks. 2 on MacOS, 1 on Windows 11 – on each device we were able to successfully exfiltrate the code.

Additional Comments

Other issues and limitations of the exploit

The limitations imposed on STTF can be found in bool TextFragmentAnchor::GenerateNewToken:

C++
  return loader.LastNavigationHadTransientUserActivation() ||
         loader.IsBrowserInitiated();

Therefore, I used onkeydown on the textarea so that while the user is typing, a window appears in the lower right corner.

To hide the popup window and allow the user to continue typing text, I open a new tab in that window and immediately close it, which returns focus to exploit window:

JavaScript
            setTimeout(()=>{var a = window.open("about:blank");a.close();},100);
            setTimeout(()=>{var a = window.open("about:blank");a.close();},700);

Also, for this exploit to work, the window must be allowed to open other windows. This can also be bypassed, but I didn't do this to avoid making the PoC even more complicated (since it is already fairly complex). So for testing, make sure your origin is allowed to use window.open.

Summary

STTF allows to leaking text char by char from cross-origin page.

Custom Questions

Reporter credit:

Vsevolod Kokorin (Slonser) of Solidlab and Jorian Woltjer

Additional Data

Category: Security
Chrome Channel: Stable
Regression: N/A \

The original report as published on the Chromium issue tracker, by Vsevolod Kokorin (Slonser) of Solidlab and Jorian Woltjer. 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. 8 min read.

Context

Scroll To Text Fragment (STTF) is the Chromium feature behind URLs of the form https://example.com/page#:~:text=some%20phrase. When a page loads with such a fragment, the browser searches the document for the given text, highlights the match and scrolls to it. The feature is meant to be a convenience for linking to a passage, but it also means the browser performs a text search inside a document that may belong to another origin.

This report describes a side channel built on top of that search. By measuring how long the STTF search takes, an attacker page can learn whether a given prefix of text exists in a cross-origin document, and by repeating the measurement character by character, exfiltrate the text. The researchers tested it against a page containing a code and were able to recover the code on every device they tried.

Setup

The proof of concept is a set of files hosted on a site controlled by the attacker (localhost is enough for testing). The files contain four configurable values:

  • TARGET: the cross-origin page whose text is to be leaked.
  • PREFIX: the text already known or being guessed.
  • FOUND: a valid prefix before the target text.
  • NOT_FOUND: an invalid prefix of the same length, used as a control.

The steps given in the report are:

  1. Download the attached files.
  2. Change TARGET, PREFIX, FOUND, NOT_FOUND if you want to test on another text or website.
  3. Host the files on localhost or a site.
  4. Open exploit_chrome.html.
  5. Start typing text.

As the user types, symbols gradually start appearing on the page. The report refers to a screen recording, PoC.mov, for the demonstration.

The exploit was tested on three devices on different internet networks: two on macOS and one on Windows 11. On each device the researchers were able to exfiltrate the code successfully.

Finding it

The starting point is that STTF performs a search whose duration depends on whether the searched text is present. The search is not constant time: a partial match triggers additional work. The researchers noticed that the number of instructions executed differs between a hit and a miss, although for a simple search the difference is negligible. The interesting question was whether that difference could be amplified and then observed from another origin.

Two obstacles stand between an attacker page and a usable measurement. The first is a security check that normally prevents STTF from being used in this situation. The second is that there is no direct way for a page to observe how long another page's STTF processing took. The report addresses both.

Exploitation

Step 1: bypass the empty Browsing Context Group check

By default, Chromium does not allow the use of STTF if there are other windows in the current Browser Context Group and the page is cross-origin. The check lives in CheckSecurityRestrictions in text_fragment_anchor.cc:

C++
    if (frame.GetPage()->RelatedPages().size()) {
      TRACE_EVENT_INSTANT("blink", "CheckSecurityRestrictions", "Result",
                          "Non-Empty Browsing Context Group");
      return false;
    }

The bypass is two lines:

JavaScript
window.location.href=`https://cross-origin-site/#:~:text=...`
window.open('/same-origin-with-attacker')

The first line navigates the current window to the cross-origin page with a text fragment. The second opens a same-origin window. Based on the researchers' tests, the check of frame.GetPage()->RelatedPages().size() runs during the redirect, and only after that does the new window begin to open. The check therefore runs before the new window begins to open.

Step 2: amplify the search time

When Chromium opens a link with an STTF, redirects may fail to execute if the text search is under heavy load. The processing order is:

  1. The text is searched with void TextAnnotationSelector::FindRange, which performs a linear search for the text.
  2. When the text is found, even partially, bool IsWordBounded and other checks are performed.
  3. Only after these steps does the highlight and scroll to the text occur.

Because the difference in instruction count for a single search is negligible, the researchers used another STTF feature to multiply the work: a URL can carry many text fragments.

Text
:~:text=...&text=...&text=...&text=......

STTF allows an unlimited number of text fragments, so tens of thousands of identical fragments can be placed in a single URL. The search operation is then performed tens of thousands of times instead of once, which slows execution down enough to measure.

Step 3: detect the time difference through history length

There is no traditional way to detect STTF timing. The researchers found an indirect one: while STTF is being processed, the redirect process is blocked. If the timing is chosen correctly, only the last redirect to about:blank executes immediately, and the number of redirects that actually occurred can be read from history.length on the window handle.

JavaScript
let w = window.opener
await sleep(TIME);
w.location = TARGET + "#1";
...
w.location = TARGET + "#5";
w.location = 'about:blank'

while(true){
    try{
        w.origin;
        ...
        if (w.history.length - previous_history_length==2){
            ... Triggered match
        }
    }catch(e){
        await sleep(100);
    }
}

The loop polls the window handle. The loop polls the window handle, and the catch block waits 100 ms before retrying. The difference in history.length is compared against the previous value. If sleep(TIME) ends before the STTF finishes, the difference is 2. Otherwise it is a higher value. The timing must therefore be chosen so that a difference of 2 is observed consistently only for the correct prefix.

Step 4: calibrate the timing per victim

Loading times differ between users because of internet connections, operating systems and other factors, so the exploit performs dynamic timing detection on the client side. The example page in the report contains:

Text
Your code: 21346375

To test for this text, the fragment is built with FOUND='Your cod' and NOT_FOUND='Your coA': a valid and an invalid prefix before the target text. It is also important that neither prefix triggers the boundary check.

The calibration is a binary search over the timing. The test is run with the current timing on both the FOUND and NOT_FOUND strings:

  1. If the function succeeds for both strings, the upper bound is decreased, because the wait is too long.
  2. If the function finds only one result and it is FOUND, the lower bound is increased.
  3. The test is repeated with (MIN_TIME + MAX_TIME) / 2.

The search stops when the difference between the upper and lower bounds is minimal. In the researchers' tests this difference was 100 milliseconds, at which point the timing has been found.

Step 5: keep the popup alive while the user types

STTF has further restrictions, visible in bool TextFragmentAnchor::GenerateNewToken:

C++
  return loader.LastNavigationHadTransientUserActivation() ||
         loader.IsBrowserInitiated();

The report quotes this check from GenerateNewToken. The exploit therefore uses onkeydown on a textarea, so that while the user is typing, a window appears in the lower right corner. To hide the popup and let the user keep typing, the exploit opens a new tab in that window and immediately closes it, which returns focus to the exploit window:

JavaScript
            setTimeout(()=>{var a = window.open("about:blank");a.close();},100);
            setTimeout(()=>{var a = window.open("about:blank");a.close();},700);

The window must also be allowed to open other windows. The report notes that this can be bypassed too, but the researchers did not do so to avoid making the PoC even more complicated. For testing, the origin must therefore be allowed to use window.open.

Root cause

STTF performs a linear text search whose cost depends on whether the text is present, and partial matches trigger additional checks in IsWordBounded and elsewhere. The resulting timing difference is tiny for one fragment, but the fragment list is unbounded, so an attacker can repeat the same search tens of thousands of times in one URL and turn a negligible difference into a measurable delay.

The existing defence, the empty Browsing Context Group check in CheckSecurityRestrictions, does not stop this because it is evaluated during the redirect, before the attacker's second window opens. The check that requires transient user activation in GenerateNewToken is satisfied by the typing interaction the exploit waits for. Finally, the redirect blocking during STTF processing gives the attacker an observable: the number of navigations that completed, read through history.length on a window handle the attacker still holds.

Impact

An attacker who can get a victim to open the exploit page and type into it can leak text from a cross-origin page character by character. The report demonstrates this against a page containing a code, and states that the code was successfully exfiltrated on all three test devices. The attack requires the victim to interact with the page so that transient user activation is present, and the attacker origin must be allowed to open windows. The timing calibration is per victim and per network, which the exploit handles automatically on the client side.

Fix

The report does not describe a fix or a change made in response. The areas it points to are the security check in CheckSecurityRestrictions, which is evaluated before the second window opens, and the unbounded number of text fragments that lets an attacker amplify the search cost.

Variants to test

  • Other fragment-driven features. Any feature that searches or parses document content in response to a URL fragment and whose cost depends on a match is a candidate. A positive result is a measurable difference in completion time between a matching and a non-matching fragment, visible from a cross-origin opener.
  • Other navigation-blocking behaviour. The history-length trick works because redirects are blocked while STTF is processed. Look for other cases where a navigation is delayed by content-dependent work and the number of completed navigations can be read from a window handle. A positive result is a stable difference in history.length between a hit and a miss.
  • Amplification through repetition. Where a URL parameter can be repeated without limit, test whether repeating it multiplies the work enough to cross the timing noise floor. A positive result is a delay that grows with the number of repetitions and differs between matching and non-matching input.
  • Bypasses of the Browsing Context Group check. The report's bypass relies on the check running during the redirect, before the second window opens. Test other orderings of navigation and window creation against the same check. A positive result is an STTF navigation that succeeds while a related page exists in the group.
  • User-activation requirements. The exploit satisfies LastNavigationHadTransientUserActivation through typing. Test other interactions that grant transient activation and see whether they are enough to drive fragment navigations from an attacker page. A positive result is a fragment navigation that proceeds without a browser-initiated load.

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. 16 min read.

What happened, in plain words

Browsers have a handy feature: if you put a special piece of text at the end of a web address, the browser will jump to that text on the page and highlight it. For example, a link ending in #:~:text=some%20phrase tells the browser to find the words "some phrase" in the page and scroll to them. This feature is called Scroll To Text Fragment, or STTF for short.

The browser has to search the page for that text, and the number of instructions executed differs slightly depending on whether the text is found. Normally that difference is far too small to notice. But the researchers in this report found a way to make the search run tens of thousands of times in a single page load, which turns a tiny difference into a delay you can measure from another website. By measuring that delay over and over, an attacker's page can work out, one character at a time, what text is on a different website that the attacker is not allowed to read directly.

In the demonstration, the target page contained a code, something like Your code: 21346375. The attacker page was able to recover that code character by character. The researchers tested it on three devices on different internet connections, two running macOS and one running Windows 11, and it worked on all of them.

This kind of attack is called a side channel: instead of breaking into the page directly, you learn something secret by watching a side effect, such as how long something takes. Think of guessing someone's PIN by timing how long they take to press the buttons, rather than by reading the PIN itself.

The pieces you need to know

Before the steps make sense, here are the basic ideas, explained from scratch.

  • A browser tab and a window. When you open a link in a new tab, the browser creates a new window object. A page can hold a reference to another window it opened, and can try to read things from it. This reference is often called a window handle.
  • Origin. Two pages have the same origin if they share the same protocol (http or https), the same domain name and the same port number. Pages from different origins are normally kept apart: one page cannot read another's content. This separation is a core browser security rule.
  • Cross-origin. Simply means "from a different origin". The attacker's page and the victim's page are cross-origin to each other.
  • Browsing Context Group. A browser concept for a set of windows and tabs that are allowed to interact with each other because they are related (for example, a page and a window it opened). Chromium uses this grouping when deciding whether certain features are safe to use.
  • Redirect. When a web address sends your browser on to a different address automatically. Like being forwarded to another department when you call a phone number.
  • about:blank. A special empty page the browser can open instantly. It is useful because it loads with no network delay.
  • history.length. Every window keeps a list of the pages you have visited in it, so the back button works. history.length is simply how many entries are in that list. Each navigation can add entries to that list.
  • window.open. A JavaScript function that opens a new window or tab. Browsers often restrict it, for example by requiring the user to have clicked or typed first.
  • Transient user activation. A short-lived permission the browser grants after the user does something deliberate, such as clicking or typing. Some features only work while this permission is active. It is like a temporary hall pass.
  • onkeydown. A JavaScript event that fires when the user presses a key. The exploit listens for it so it knows the user is typing.
  • textarea. A multi-line text input box on a web page.
  • setTimeout. A JavaScript function that runs some code after a delay, measured in milliseconds. 1000 milliseconds is one second.
  • Binary search. A way of finding a value by repeatedly halving a range. Guess the middle; if it is too high, look in the lower half; if too low, look in the upper half; repeat. Like finding a word in a dictionary by opening it in the middle each time.
  • Constant time. A program runs in constant time if it takes the same amount of time regardless of the input. A search that takes longer when it finds something is not constant time, and that difference is exactly what this attack exploits.
  • Instruction count. Roughly, how many small operations the computer performs. More instructions means more time.
  • Prefix. The beginning of a piece of text. If the secret is 21346375, then 2134 is a prefix of it.
  • Exfiltration. Getting data out of a place it was supposed to stay. Here, copying text from another website into the attacker's page.
  • Proof of concept (PoC). A small demonstration that proves an attack works.

Setting up the demonstration

The proof of concept is a set of files hosted on a site the attacker controls. For testing, running them on your own computer (localhost) is enough. The files contain four settings you can change:

  • TARGET: the address of the cross-origin page whose text is to be leaked.
  • PREFIX: the text already known, or the part currently being guessed.
  • FOUND: a valid prefix that appears just before the target text.
  • NOT_FOUND: an invalid prefix of the same length, used as a control to compare against.

The report gives these steps:

  1. Download the attached files.
  2. Change TARGET, PREFIX, FOUND, NOT_FOUND if you want to test on another text or website.
  3. Host the files on localhost or a site.
  4. Open exploit_chrome.html.
  5. Start typing text.

As the user types, symbols gradually start appearing on the page. The report refers to a screen recording, PoC.mov, for the demonstration.

The exploit was tested on three devices on different internet networks: two on macOS and one on Windows 11. On each device the researchers were able to exfiltrate the code successfully.

How the researchers found it

The starting observation is that STTF performs a search whose duration depends on whether the searched text is present. The search is not constant time: a partial match triggers extra work. The researchers noticed that the number of instructions executed differs between a hit and a miss, although for a single simple search the difference is negligible. The interesting question was whether that difference could be amplified and then observed from another origin.

Two obstacles stand between an attacker page and a usable measurement. The first is a security check that normally prevents STTF from being used in this situation. The second is that there is no direct way for a page to observe how long another page's STTF processing took. The report addresses both.

Step 1: getting past the empty Browsing Context Group check

By default, Chromium does not allow the use of STTF if there are other windows in the current Browsing Context Group and the page is cross-origin. In plain terms: if the browser thinks other related windows are open, it refuses to run the text search on a page from a different site. The check lives in a function called CheckSecurityRestrictions in a source file named text_fragment_anchor.cc:

C++
    if (frame.GetPage()->RelatedPages().size()) {
      TRACE_EVENT_INSTANT("blink", "CheckSecurityRestrictions", "Result",
                          "Non-Empty Browsing Context Group");
      return false;
    }

Line by line:

  • if (frame.GetPage()->RelatedPages().size()) { asks: does this page have any related pages (other windows in the same group)? .size() returns how many there are. If the number is anything other than zero, the condition is true.
  • TRACE_EVENT_INSTANT(...) records a note for debugging, saying the check failed because the Browsing Context Group was not empty.
  • return false; means "not allowed", so the STTF search is refused.

The bypass is two lines of JavaScript:

JavaScript
window.location.href=`https://cross-origin-site/#:~:text=...`
window.open('/same-origin-with-attacker')

Line by line:

  • window.location.href=... tells the current window to navigate to the cross-origin page, with a text fragment attached (the #:~:text=... part).
  • window.open('/same-origin-with-attacker') opens a new window pointing at a page on the attacker's own site. This opens a new window pointing at a page on the attacker's own site.

Why does this work? Based on the researchers' tests, the check of frame.GetPage()->RelatedPages().size() runs during the redirect, and only after that does the new window begin to open. So the check runs during the redirect, before the new window begins to open. It is a race: the check happens before the second window exists.

Step 2: making the search slow enough to measure

When Chromium opens a link with an STTF, redirects may fail to execute if the text search is under heavy load. The processing order is:

  1. The text is searched with void TextAnnotationSelector::FindRange, which performs a linear search for the text. A linear search means checking the page from start to finish, one position at a time.
  2. When the text is found, even partially, bool IsWordBounded and other checks are performed. These are additional checks performed after a partial match.
  3. Only after these steps does the highlight and scroll to the text occur.

Because the difference in instruction count for a single search is negligible, the researchers used another STTF feature to multiply the work: a URL can carry many text fragments.

Text
:~:text=...&text=...&text=...&text=......

This is the fragment part of a URL. Each text= section asks the browser to find one piece of text, and they are joined with &. STTF allows an unlimited number of text fragments, so tens of thousands of identical fragments can be placed in a single URL. The search operation is then performed tens of thousands of times instead of once, which slows execution down enough to measure. Think of it as asking someone to find a word in a book once (fast) versus ten thousand times (slow).

Step 3: spotting the delay through history length

There is no traditional way to detect STTF timing. The researchers found an indirect one: while STTF is being processed, the redirect process is blocked. If the timing is chosen correctly, only the last redirect to about:blank executes immediately, and the number of redirects that actually occurred can be read from history.length on the window handle.

JavaScript
let w = window.opener
await sleep(TIME);
w.location = TARGET + "#1";
...
w.location = TARGET + "#5";
w.location = 'about:blank'

while(true){
    try{
        w.origin;
        ...
        if (w.history.length - previous_history_length==2){
            ... Triggered match
        }
    }catch(e){
        await sleep(100);
    }
}

Line by line:

  • let w = window.opener grabs a handle to the window that opened this one. That is the window the exploit wants to watch.
  • await sleep(TIME); waits for a chosen amount of time before starting the navigation sequence.
  • w.location = TARGET + "#1"; and the following lines send the watched window to the target page several times, each time with a different fragment (#1, up to #5). Each of these is a navigation of the watched window.
  • w.location = 'about:blank' is the final navigation, to an empty page. Because about:blank loads instantly, it is the one that will complete immediately if the earlier navigations are still blocked.
  • while(true){ starts an endless loop that keeps checking the window.
  • try{ w.origin; ... } tries to read the window's origin. The loop tries to read the window's origin inside a try block.
  • if (w.history.length - previous_history_length==2){ ... Triggered match } compares the current history length with the value recorded before. A difference of exactly 2 means the timing matched.
  • catch(e){ await sleep(100); } catches the error and waits 100 milliseconds before trying again.

Why does a difference of 2 mean a match? If sleep(TIME) ends before the STTF finishes, the difference is 2. Otherwise, more of the navigations complete and the difference is a higher value. The timing must therefore be chosen so that a difference of 2 is observed consistently only for the correct prefix.

Step 4: tuning the timing for each victim

Loading times differ between users because of internet connections, operating systems and other factors, so the exploit performs dynamic timing detection on the client side. In other words, it measures the right delay on the victim's own machine rather than assuming one. The example page in the report contains:

Text
Your code: 21346375

To test for this text, the fragment is built with FOUND='Your cod' and NOT_FOUND='Your coA': a valid and an invalid prefix before the target text. Your cod is the real beginning of the line, so the search should find it. Your coA is the same length but wrong at the last character, so the search should not find it. It is also important that neither prefix triggers the boundary check.

The calibration is a binary search over the timing. The test is run with the current timing on both the FOUND and NOT_FOUND strings:

  1. If the function succeeds for both strings, the upper bound is decreased, because the wait is too long.
  2. If the function finds only one result and it is FOUND, the lower bound is increased.
  3. The test is repeated with (MIN_TIME + MAX_TIME) / 2, the midpoint of the current range.

The search stops when the difference between the upper and lower bounds is minimal. In the researchers' tests this difference was 100 milliseconds, at which point the timing has been found.

Step 5: keeping the popup alive while the user types

STTF has further restrictions, visible in bool TextFragmentAnchor::GenerateNewToken:

C++
  return loader.LastNavigationHadTransientUserActivation() ||
         loader.IsBrowserInitiated();

Line by line:

  • loader.LastNavigationHadTransientUserActivation() asks whether the last navigation happened while the user had recently done something deliberate, such as typing or clicking.
  • || means "or".
  • loader.IsBrowserInitiated() asks whether the browser itself started the navigation, for example because the user typed the address or clicked a bookmark.

So a text fragment navigation needs transient user activation or must be browser-initiated. The exploit therefore uses onkeydown on a textarea, so that while the user is typing, a window appears in the lower right corner. The typing is what supplies the activation.

To hide the popup and let the user keep typing, the exploit opens a new tab in that window and immediately closes it, which returns focus to the exploit window:

JavaScript
            setTimeout(()=>{var a = window.open("about:blank");a.close();},100);
            setTimeout(()=>{var a = window.open("about:blank");a.close();},700);

Line by line:

  • setTimeout(()=>{ ... },100); runs the code inside the braces after 100 milliseconds.
  • var a = window.open("about:blank"); opens a new empty tab and stores a handle to it in a.
  • a.close(); closes that tab straight away.
  • The second line does the same thing after 700 milliseconds.

Why open and close a tab? Opening a new tab in the popup and immediately closing it returns focus to the exploit window, so the victim can carry on typing.

The window must also be allowed to open other windows. The report notes that this can be bypassed too, but the researchers did not do so to avoid making the PoC even more complicated. For testing, the origin must therefore be allowed to use window.open.

Why it works at all

STTF performs a linear text search whose cost depends on whether the text is present, and partial matches trigger additional checks in IsWordBounded and elsewhere. The resulting timing difference is tiny for one fragment, but the fragment list is unbounded, so an attacker can repeat the same search tens of thousands of times in one URL and turn a negligible difference into a measurable delay.

The existing defence, the empty Browsing Context Group check in CheckSecurityRestrictions, does not stop this because it is evaluated during the redirect, before the attacker's second window opens. The check that requires transient user activation in GenerateNewToken is satisfied by the typing interaction the exploit waits for. Finally, the redirect blocking during STTF processing gives the attacker an observable: the number of navigations that completed, read through history.length on a window handle the attacker still holds.

What an attacker could do with it

An attacker who can get a victim to open the exploit page and type into it can leak text from a cross-origin page character by character. The report demonstrates this against a page containing a code, and states that the code was successfully exfiltrated on all three test devices. The attack requires the victim to interact with the page so that transient user activation is present, and the attacker origin must be allowed to open windows. The timing calibration is per victim and per network, which the exploit handles automatically on the client side.

Fix

The report does not describe a fix or a change made in response. The areas it points to are the security check in CheckSecurityRestrictions, which is evaluated before the second window opens, and the unbounded number of text fragments that lets an attacker amplify the search cost.

Other things worth testing

  • Other fragment-driven features. Any feature that searches or parses document content in response to a URL fragment and whose cost depends on a match is a candidate. A positive result is a measurable difference in completion time between a matching and a non-matching fragment, visible from a cross-origin opener.
  • Other navigation-blocking behaviour. The history-length trick works because redirects are blocked while STTF is processed. Look for other cases where a navigation is delayed by content-dependent work and the number of completed navigations can be read from a window handle. A positive result is a stable difference in history.length between a hit and a miss.
  • Amplification through repetition. Where a URL parameter can be repeated without limit, test whether repeating it multiplies the work enough to cross the timing noise floor. A positive result is a delay that grows with the number of repetitions and differs between matching and non-matching input.
  • Bypasses of the Browsing Context Group check. The report's bypass relies on the check running during the redirect, before the second window opens. Test other orderings of navigation and window creation against the same check. A positive result is an STTF navigation that succeeds while a related page exists in the group.
  • User-activation requirements. The exploit satisfies LastNavigationHadTransientUserActivation through typing. Test other interactions that grant transient activation and see whether they are enough to drive fragment navigations from an attacker page. A positive result is a fragment navigation that proceeds without a browser-initiated load.

Glossary

  • Scroll To Text Fragment (STTF): a browser feature that lets a link point to a specific piece of text on a page, which the browser then finds, highlights and scrolls to.
  • Side channel: learning secret information by observing a side effect, such as timing, rather than by reading the data directly.
  • Origin: the combination of protocol, domain name and port that identifies where a page came from; pages from different origins are kept apart.
  • Cross-origin: belonging to a different origin than the page you are on.
  • Browsing Context Group: a set of browser windows and tabs that are related and allowed to interact.
  • Redirect: an automatic forward from one web address to another.
  • about:blank: a built-in empty page that loads instantly.
  • history.length: the number of entries in a window's browsing history, used by the back and forward buttons.
  • Window handle: a reference a page holds to another window, which it can use to read limited information or send it places.
  • Transient user activation: a short-lived permission the browser grants after the user clicks or types, required by some features.
  • onkeydown: a JavaScript event that fires when a key is pressed.
  • setTimeout: a JavaScript function that runs code after a delay in milliseconds.
  • Binary search: finding a value by repeatedly halving a range and testing the middle.
  • Constant time: taking the same amount of time regardless of the input.
  • Instruction count: roughly how many small operations a computer performs; more instructions means more time.
  • Linear search: checking a document from start to finish, one position at a time.
  • Word boundary: the edge of a word, used so that a search for a short word does not match inside a longer one.
  • Prefix: the beginning of a piece of text.
  • Exfiltration: copying data out of a place where it was meant to stay.
  • Race condition: a situation where the result depends on the exact order in which two things happen.
  • Noise floor: the level of random variation below which a measurement cannot be trusted.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.