Skip to content
UI spoofing Advisory Intermediate CVE-2024-6996

Race in Frames (CVE-2024-6996)

The Intersection Observer v2 API incorrectly reported a hidden iframe as visible, allowing a malicious site to trick a victim into clicking an invisible Google One Tap login button and have their identity (email) disclosed to the attacker.

Louis Jannett Follow

Originally disclosed on Chrome VRP

Bounty$5,000 Medium View original
  • Fix shipped in 3 months

VULNERABILITY DETAILS

The Intersection Observer v2 API fails to correctly and reliably determine a target's visibility. The API determines that a target is visible, although it is hidden, i.e., by setting the opacity down to 0%.

The Google One Tap SDK embeds an iframe that uses this API to determine if its login button is visible to a user. If the login button is not visible, the button triggers a popup to appear that asks for the user's consent to log in to the website. If the login button is visible, the button immediately triggers the iframe to issue the user's identity to the website.

Since the Intersection Observer v2 API does not reliably determine the login button's visibility, clickjacking attacks are possible. Some malicious website can trick the victim into clicking the invisible login button of the GOT SDK, followed by Google issuing the victim's identity to the malicious website (= deanonymization).

While testing, I noticed that the API works in some cases, which might be due to caching / race condition. For example, if a.com frames a.com, then the API works as expected. However, when b.com frames a.com and a.com uses the API, then the visibility is reported inaccurate in most cases.

For example, start an incognito window and open the same-site case. The iframe should detect that its not visible (= red background). Now close it, start a new incognito window, and open the cross-site case. The iframe should fail to detect that it is not visible (= green background).

VERSION

Chrome Version: 123.0.6312.107 stable

Operating System: macOS 14.3.1 (23D60)

REPRODUCTION CASE

See the video for a demonstration.

CREDIT INFORMATION Externally reported security bugs may appear in Chrome release notes. If this bug is included, how would you like to be credited? Reporter credit: Louis Jannett (Ruhr University Bochum)

The original report as published on the Chromium issue tracker, by Louis Jannett (Ruhr University Bochum). 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

Chrome's Intersection Observer v2 API is meant to tell a page whether a target element is actually visible to the user, not merely present in the layout. The Google One Tap SDK uses this API inside an embedded iframe to decide how to handle a user's login button. If the button is not visible, the SDK shows a popup asking the user for consent to log in. If the button is visible, the SDK skips the popup and immediately has the iframe issue the user's identity to the embedding website.

The report shows that this visibility determination can be wrong: the API can report a target as visible when it is hidden, for example by setting its opacity to 0%. Because the One Tap SDK trusts that answer, a malicious site can trick a signed-in victim into clicking an invisible login button, after which Google hands the victim's identity to the malicious site. The report calls this deanonymization.

Setup

The testing was done on Chrome 123.0.6312.107 stable on macOS 14.3.1 (23D60). The reproduction requires a clean Chrome profile with no cache and default configuration, and a user signed in to a Google account. The researcher also used two proof-of-concept pages, one for the same-site case and one for the cross-site case, plus a framer tool that loads a target page inside a frame.

Finding it

The researcher noticed that the API does not fail consistently. In some cases it works as expected, which the report suggests might be due to caching or a race condition. The pattern observed was:

  • If a.com frames a.com, the API works as expected.
  • If b.com frames a.com and a.com uses the API, the visibility is reported inaccurately in most cases.

To demonstrate the difference, the researcher gives two manual checks. In a fresh incognito window, open the same-site case:

Text
https://pocs.work/tools/framer/#https://pocs.work/demo/intersection-observer-v2/frame.html

Here the iframe should detect that it is not visible, shown as a red background. Then close the window, start a new incognito window, and open the cross-site case:

Text
https://pocs.lol/tools/framer/#https://pocs.work/demo/intersection-observer-v2/frame.html

In this case the iframe should fail to detect that it is not visible, shown as a green background. The colour is the signal: red means the API correctly reported the hidden state, green means it reported the target as visible when it was not.

Exploitation

Step 1: Prepare a clean profile and session

Create a clean Chrome profile with no cache and default settings, then sign in to a Google account. This ensures the One Tap SDK has an identity to issue and that no cached state interferes with the visibility result.

Step 2: Open the proof-of-concept page

Navigate to:

Text
https://pocs.lol/pocs/2024/google-one-tap-clickjacking/

This page demonstrates the clickjacking attack against the One Tap SDK.

Step 3: Trick the click

Click the button labelled "click me to see funny cats". The click is intended to land on the invisible One Tap login button.

Step 4: Wait for the identity

Wait a few seconds. The iframe issues the user's identity to the embedding site. The victim's email address then appears on the website.

The report refers to a video for a demonstration of this flow.

Root cause

The Intersection Observer v2 API fails to correctly and reliably determine a target's visibility. It can report a target as visible even when the target is hidden, for example by setting opacity to 0%. The One Tap SDK treats that report as trustworthy: a visible button means immediate issuance of identity, while a hidden button means a consent popup. With the visibility check defeated, the consent step is skipped.

The report notes that the behaviour is not deterministic and suggests caching or a race condition as a possible explanation, since same-site framing behaves correctly while cross-site framing is inaccurate in most cases. The exact mechanism is not established in the report.

Impact

A malicious website can trick a signed-in victim into clicking an invisible Google One Tap login button. Instead of the consent popup the user would normally see, Google issues the victim's identity to the malicious website. The report describes this as deanonymization. The attack requires the victim to be signed in to a Google account and to interact with the malicious page, and it depends on the cross-site framing case producing the inaccurate visibility result, which the report says happens in most cases rather than always.

Fix

The report does not describe a fix or a change made in response.

Variants to test

  1. Frame a page that uses Intersection Observer v2 from a different site and hide the target with opacity 0%. A positive result is the framed page reporting the target as visible (green in the researcher's demo) instead of hidden (red).
  2. Repeat the same test with same-site framing as a control. A positive control result is the framed page correctly reporting the target as hidden.
  3. Repeat the cross-site test in fresh incognito windows several times. A positive result is the inaccurate visibility report recurring across runs, which would support the caching or race condition explanation.
  4. Apply the same pattern to other SDKs that branch on Intersection Observer v2 visibility, such as consent or login widgets. A positive result is the widget skipping a consent or confirmation step because it believes a hidden element is visible.
  5. Vary the hiding technique beyond opacity 0%, for example other CSS that makes the element invisible without removing it from the layout. A positive result is the API still reporting the target as visible.

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

What happened, in plain words

Chrome has a feature that lets a web page ask the browser a simple question: "is this element on my page actually visible to the person looking at the screen?" The feature is called the Intersection Observer v2 API. An API, in this context, is a set of commands that one piece of software offers to another so they can talk to each other. Think of it like a waiter in a restaurant: the page asks a question, the browser answers it, and the page does not need to know how the kitchen works.

Google uses this feature in a product called the Google One Tap SDK. An SDK (software development kit) is a ready-made bundle of code that a website can drop in to get a feature without building it from scratch. Google One Tap is a small login box that lets people sign in to a website with their Google account in one click. The SDK puts its login button inside an iframe. An iframe is a small window embedded inside a web page that loads content from another address, like a picture-in-picture television inside a bigger television.

The SDK uses the visibility question to decide what to do next. If the login button is hidden from the user, the SDK shows a popup asking the user to confirm they want to log in. If the button is visible, the SDK skips the popup and immediately tells the website who the user is.

The bug is that the visibility answer can be wrong. The browser can say "yes, this button is visible" when the button has actually been made invisible, for example by setting its opacity to 0%. Opacity is how see-through something is: 100% is fully solid, 0% is completely invisible but still present on the page and still clickable.

Because the One Tap SDK trusts that wrong answer, a malicious website can trick the victim into clicking the invisible login button. This kind of trick is called clickjacking: the victim thinks they are clicking one thing but actually click another. The result is that Google hands the victim's identity to the malicious site. The report calls this deanonymization, meaning the victim loses their anonymity because their real identity is revealed to someone they did not intend to share it with.

Context

The Intersection Observer v2 API is supposed to tell a page whether a target element is genuinely visible to the user, not just present in the page layout. An element can be in the layout, taking up space, and still be invisible: for example, if it is fully transparent. The API is meant to catch that difference.

The Google One Tap SDK uses this API inside an embedded iframe to decide how to handle the user's login button. The two branches are:

  • If the button is not visible, the SDK shows a popup asking the user for consent to log in.
  • If the button is visible, the SDK skips the popup and immediately has the iframe issue the user's identity to the embedding website.

The report shows that this visibility determination can be wrong: the API can report a target as visible when it is hidden, for example by setting its opacity to 0%. Because the One Tap SDK trusts that answer, a malicious site can trick a signed-in victim into clicking an invisible login button, after which Google hands the victim's identity to the malicious site. The report calls this deanonymization.

Setup

The testing was done on Chrome 123.0.6312.107 stable on macOS 14.3.1 (23D60). The reproduction requires a clean Chrome profile with no cache and default configuration, and a user signed in to a Google account. A browser profile is the folder where Chrome keeps your settings, history and saved logins; a clean profile is like a brand-new browser that has never visited anything. A cache is a store of previously downloaded files that the browser reuses to load pages faster; clearing it ensures the test is not influenced by old copies of a page.

The researcher also used two proof-of-concept pages, one for the same-site case and one for the cross-site case, plus a framer tool that loads a target page inside a frame. A proof of concept is a small demonstration built to show that a bug is real, without doing any harm. Same-site means the page doing the framing and the page being framed come from the same website; cross-site means they come from different websites.

Finding it

The researcher noticed that the API does not fail consistently. In some cases it works as expected, which the report suggests might be due to caching or a race condition. A race condition is when the result of a process depends on the timing of events that happen in parallel, like two people reaching for the same door handle at the same moment: who gets there first changes the outcome. The pattern observed was:

  • If a.com frames a.com, the API works as expected.
  • If b.com frames a.com and a.com uses the API, the visibility is reported inaccurately in most cases.

To demonstrate the difference, the researcher gives two manual checks. In a fresh incognito window, open the same-site case:

Text
https://pocs.work/tools/framer/#https://pocs.work/demo/intersection-observer-v2/frame.html

This address loads a tool page from pocs.work and, after the # symbol, tells it which page to load inside a frame: another page on pocs.work. Because both addresses belong to the same site, this is the same-site case. Here the iframe should detect that it is not visible, shown as a red background.

Then close the window, start a new incognito window, and open the cross-site case:

Text
https://pocs.lol/tools/framer/#https://pocs.work/demo/intersection-observer-v2/frame.html

This time the tool page comes from pocs.lol but the page loaded inside the frame comes from pocs.work. Two different sites, so this is the cross-site case. In this case the iframe should fail to detect that it is not visible, shown as a green background.

The colour is the signal: red means the API correctly reported the hidden state, green means it reported the target as visible when it was not. Starting each check in a fresh incognito window matters because incognito mode starts without the previous session's cache and cookies, so each run begins from the same clean state.

Exploitation

Step 1: Prepare a clean profile and session

Create a clean Chrome profile with no cache and default settings, then sign in to a Google account. This ensures the One Tap SDK has an identity to issue and that no cached state interferes with the visibility result. Signing in matters because the whole attack depends on Google knowing who the victim is; if nobody is signed in, there is no identity to hand over.

Step 2: Open the proof-of-concept page

Navigate to:

Text
https://pocs.lol/pocs/2024/google-one-tap-clickjacking/

This page demonstrates the clickjacking attack against the One Tap SDK. In other words, the button is there and can receive a click, but the victim cannot see it.

Step 3: Trick the click

Click the button labelled "click me to see funny cats". The click is intended to land on the invisible One Tap login button. This is the clickjacking step: the visible decoy gives the victim a reason to click in that spot, and the hidden button underneath receives the click.

Step 4: Wait for the identity

Wait a few seconds. The iframe issues the user's identity to the embedding site. The victim's email address then appears on the website. The consent popup is the safety step that would normally give the user a chance to say no; skipping it is what makes the attack work.

The report refers to a video for a demonstration of this flow.

Root cause

The Intersection Observer v2 API fails to correctly and reliably determine a target's visibility. It can report a target as visible even when the target is hidden, for example by setting opacity to 0%. The One Tap SDK treats that report as trustworthy: a visible button means immediate issuance of identity, while a hidden button means a consent popup. With the visibility check defeated, the consent step is skipped.

The report notes that the behaviour is not deterministic and suggests caching or a race condition as a possible explanation, since same-site framing behaves correctly while cross-site framing is inaccurate in most cases. The exact mechanism is not established in the report.

Impact

A malicious website can trick a signed-in victim into clicking an invisible Google One Tap login button. Instead of the consent popup the user would normally see, Google issues the victim's identity to the malicious website. The report describes this as deanonymization. The attack requires the victim to be signed in to a Google account and to interact with the malicious page, and it depends on the cross-site framing case producing the inaccurate visibility result, which the report says happens in most cases rather than always.

Fix

The report does not describe a fix or a change made in response.

Variants to test

  1. Frame a page that uses Intersection Observer v2 from a different site and hide the target with opacity 0%. A positive result is the framed page reporting the target as visible (green in the researcher's demo) instead of hidden (red).
  2. Repeat the same test with same-site framing as a control. A control is a comparison run where you expect the normal, correct behaviour, so you can tell whether a failure is really caused by the thing you changed. A positive control result is the framed page correctly reporting the target as hidden.
  3. Repeat the cross-site test in fresh incognito windows several times. A positive result is the inaccurate visibility report recurring across runs, which would support the caching or race condition explanation.
  4. Apply the same pattern to other SDKs that branch on Intersection Observer v2 visibility, such as consent or login widgets. A positive result is the widget skipping a consent or confirmation step because it believes a hidden element is visible.
  5. Vary the hiding technique beyond opacity 0%, for example other CSS that makes the element invisible without removing it from the layout. CSS is the language that describes how a web page looks. A positive result is the API still reporting the target as visible.

Glossary

  • API: a set of commands one piece of software offers to another so they can communicate, like a waiter taking orders between a customer and the kitchen.
  • Browser profile: the folder where a browser stores settings, history and saved logins; a clean profile behaves like a brand-new browser.
  • Cache: a store of previously downloaded files that the browser reuses to load pages faster.
  • Clickjacking: tricking a user into clicking something different from what they think they are clicking, usually by hiding one element under another.
  • Consent popup: a dialog that asks the user to confirm before an action, such as logging in, takes place.
  • Control: a comparison run where normal, correct behaviour is expected, used to check whether a failure is caused by the thing being tested.
  • Cross-site: involving two different websites, for example one site framing a page from another site.
  • CSS: the language that describes how a web page looks, including colours, sizes and transparency.
  • Deanonymization: revealing a person's real identity to someone they did not intend to share it with.
  • Framer tool: a page that loads another page inside a frame, used here to set up the same-site and cross-site tests.
  • Google One Tap SDK: a ready-made bundle of code from Google that adds a one-click Google login box to a website.
  • Iframe: a small window embedded inside a web page that loads content from another address, like a picture-in-picture television inside a bigger television.
  • Incognito window: a browser window that starts without the previous session's cache and cookies, giving each test a clean starting state.
  • Intersection Observer v2 API: a browser feature that lets a page ask whether a target element is actually visible to the user, not merely present in the layout.
  • Opacity: how see-through an element is; 0% means completely invisible but still present on the page and still clickable.
  • Proof of concept: a small demonstration built to show that a bug is real, without doing any harm.
  • Race condition: a situation where the result depends on the timing of parallel events, like two people reaching for the same door handle at the same moment.
  • Same-site: involving one website, for example a site framing a page from the same site.
  • SDK (software development kit): a ready-made bundle of code that a website can drop in to get a feature without building it from scratch.
  • Stable: the regular release channel of a browser, as opposed to beta or developer builds.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Clickjacking and UI spoofing

The lesson behind this report.

The interface lies to the user: a framed page catches their clicks, or a browser shows the wrong address or a fake prompt. Paid when it leads to a sensitive action or convincing phishing.