Skip to content

Commit

Permalink
Merge pull request #167 from JorianWoltjer/master
Browse files Browse the repository at this point in the history
Add status code leak using CSS history retrieval
  • Loading branch information
terjanq committed Jul 6, 2024
2 parents c7d88fb + 287baf1 commit ad1e58d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions content/docs/attacks/css-tricks.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ This issue has been known for years and there are multiple open bugs to be fixed
[^bug-3]: :visited support allows queries into global history, [link](https://bugzilla.mozilla.org/show_bug.cgi?id=147777)
{{< /hint >}}

## Leaking status code

Tricks to reveal a user's history provide a way to detect the status code of a response cross-site. Chromium-based browsers will only save responses with OK status codes (e.g. 200) to the user's history, but won't add error status codes (e.g. 404). By visiting the target URL in a popup window, it will then either be saved to the history or not depending on the status code. After then placing the same URL on your page with `<a href="...">`, it is possible to use one of the manual or automatic techniques described above to leak whether this URL was saved to the history or not.

In some XS-Search scenarios, a search with no results will return a 404 error. Cookies marked `SameSite=Lax` will be sent in popup windows, and this technique allows such scenarios to be exploited. [^exploit-1]

## Evil Captcha
Using CSS, it’s possible to take an embed out of context.
An example of this is pretending it’s a captcha as seen in [^leak-2]
Expand Down Expand Up @@ -83,12 +89,14 @@ A custom cursor might not leak data directly but it may help trick the user, as
[XFO]({{< ref "/docs/defenses/opt-in/xfo.md" >}}) prevents embeds from being attacked because there's no visual difference as the content does not get shown.
The *Retrieving user's history* attack can only be prevented by the user.
This can be done by disabling the browser history, or if on Firefox, by setting the option `layout.css.visited_links_enabled` to `false` in `about:config` panel.
| [SameSite Cookies (Lax)]({{< ref "/docs/defenses/opt-in/same-site-cookies.md" >}}) | [COOP]({{< ref "/docs/defenses/opt-in/coop.md" >}}) | [Framing Protections]({{< ref "/docs/defenses/opt-in/xfo.md" >}}) | [Isolation Policies]({{< ref "/docs/defenses/isolation-policies" >}}) |
| :--------------------------------------------------------------------------------: | :-------------------------------------------------: | :---------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------: |
||| ✔️ ||
## References
| [SameSite Cookies (Lax)]({{< ref "/docs/defenses/opt-in/same-site-cookies.md" >}}) | [COOP]({{< ref "/docs/defenses/opt-in/coop.md" >}}) | [Framing Protections]({{< ref "/docs/defenses/opt-in/xfo.md" >}}) | [Isolation Policies]({{< ref "/docs/defenses/isolation-policies" >}}) |
| :--------------------------------------------------------------------------------: | :-------------------------------------------------: | :---------------------------------------------------------------: | :-------------------------------------------------------------------: |
||| ✔️ ||
## References
[^leak-1]: Whack a mole game, [link](https://lcamtuf.coredump.cx/whack/)
[^changes-1]: Privacy and the :visited selector, [link](https://developer.mozilla.org/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector)
[^blend-mode]: CSS mix-blend-mode is bad for your browsing history, [link](https://lcamtuf.blogspot.com/2016/08/css-mix-blend-mode-is-bad-for-keeping.html)
[^render-timings]: Pixel Perfect Timing Attacks with HTML5, [link](https://owasp.org/www-pdf-archive/HackPra_Allstars-Browser_Timing_Attacks_-_Paul_Stone.pdf)
[^exploit-1]: XS-Leaking flags with CSS: A CTFd 0day, [link](https://jorianwoltjer.com/blog/p/hacking/xs-leaking-flags-with-css-a-ctfd-0day)
[^render-timings-bug]: Visited links can be detected via redraw timing, [link](https://bugs.chromium.org/p/chromium/issues/detail?id=252165)
[^leak-2]: The Human Side Channel, [link](https://ronmasas.com/posts/the-human-side-channel)
2 changes: 1 addition & 1 deletion content/docs/contributions/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ We would like to thank the following users who [contributed](https://github.com/
[Brasco](https://github.com/Brasco/), [rick.titor](https://github.com/riccardomerlano),
[Chris Fredrickson](https://github.com/cfredric/), [jub0bs](https://github.com/jub0bs),
[Zeyu (Zayne) Zhang](https://github.com/zeyu2001), [Medi](https://twitter.com/medi_0ne),
[Aaron Shim](https://github.com/aaronshim)
[Aaron Shim](https://github.com/aaronshim), [Jorian Woltjer](https://jorianwoltjer.com)

In addition, we would also like to acknowledge the users who [contributed](https://github.com/xsleaks/xsleaks/wiki/Browser-Side-Channels/_history) to the predecessor of the current XS-Leaks wiki:

Expand Down

0 comments on commit ad1e58d

Please sign in to comment.