CSS Tricks
October 1, 2020
CSS Tricks #
CSS can be used to trick a user into exposing information such as embedded pixel values by making visual changes that are affected by the embed.
Retrieving user’s history #
Using the CSS :visited
selector, it’s possible to apply a different style for URLs that have been visited.
Previously it was possible to use getComputedStyle()
to detect this difference, but now browsers prevent this by always returning values as if the link was visited and limiting what styles can be applied using the selector. 1
So, it may be needed to trick the user into clicking an area that the CSS has affected.
This can be done using mix-blend-mode
. 2
There are also ways to do it without user interaction such as by abusing render timings.
This works because it takes time to paint links in a different color. 3
A Proof of Concept to this attack can be found in a Chromium report 4 and it works by having multiple links to increase the time difference.