You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4405bee
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: content/docs/attacks/cache-probing.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,15 +60,15 @@ It's also possible to remove resources from cache without server errors. For exa
60
60
61
61
## CORS error on Origin Reflection misconfiguration
62
62
63
-
Origin reflection is a behavior in which a globally accessible resource is provided with a [Access-Control-Allow-Orign (ACAO)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin) header whose value reflects the origin that initialized the request. This can be considered as CORS misconfiguration [^5] and can be used to detect whether the resource exists in the browser cache.
63
+
Origin reflection is a behavior in which a globally accessible resource is provided with a [Access-Control-Allow-Origin (ACAO)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin) header whose value reflects the origin that initialized the request. This can be considered as CORS misconfiguration [^5] and can be used to detect whether the resource exists in the browser cache.
64
64
65
65
{{< hint info >}}
66
66
For example, Flask framework [promotes](https://flask-cors.readthedocs.io/en/latest/api.htm) origin reflection as the default behavior.
67
67
{{< /hint >}}
68
68
69
69
If a resource hosted on `server.com` is requested from `target.com` then the origin could be reflected in the response headers as: `Access-Control-Allow-Origin: target.com`. If the resource is cached, this information is stored together with the resource in the browser cache. With that, if `attacker.com` tries to fetch the same resource there are two possible scenarios:
70
70
- The resource is not in cache: the resource could be fetched and stored together with the `Access-Control-Allow-Origin: attacker.com` header.
71
-
- The resource was already in cache: fetch attempt will try to fetch the resource from the cache but it will also generate a CORS error due to the ACAO header value mismatch with the requesting origin (`target.com` origin was expected but `attacker.com` was provided). Here below is provided an example code snippet epxloting this vulnerability to infer the cache status of the victim's browser. [Run demo](https://xsinator.com/testing.html#Cache%20Leak%20(CORS))
71
+
- The resource was already in cache: fetch attempt will try to fetch the resource from the cache but it will also generate a CORS error due to the ACAO header value mismatch with the requesting origin (`target.com` origin was expected but `attacker.com` was provided). Here below is provided an example code snippet exploiting this vulnerability to infer the cache status of the victim's browser. [Run demo](https://xsinator.com/testing.html#Cache%20Leak%20(CORS))
72
72
```javascript
73
73
// The function simply takes a url and fetches it in CORS mode.
74
74
// If the fetch raises an error, it will be a CORS error due to the
Copy file name to clipboardExpand all lines: content/docs/attacks/css-tricks.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ CSS can be used to trick a user into exposing information such as embedded pixel
20
20
21
21
## Retrieving user's history
22
22
Using the CSS [`:visited`](https://developer.mozilla.org/en-US/docs/Web/CSS/:visited) selector, it’s possible to apply a different style for URLs that have been visited.
23
-
Previously it was possible to use [`getComputedStyle()`](https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle) to detect this difference, but now browsers prevent this by always returing values as if the link was visted and limiting what styles can be applyed using the selector. [^changes-1]
23
+
Previously it was possible to use [`getComputedStyle()`](https://developer.mozilla.org/en-US/docs/Web/API/Window/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. [^changes-1]
24
24
So, it may be needed to trick the user into clicking an area that the CSS has affected.
25
25
This can be done using [`mix-blend-mode`](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode). [^blend-mode]
26
26
There are also ways to do it without user interaction such as by abusing render timings.
@@ -32,8 +32,8 @@ Multiple bugs were reported about this issue: [^bug-1](https://bugs.chromium.org
32
32
## Evil Captcha
33
33
Using CSS, it’s possible to take an embed out of context.
34
34
An example of this is pretending it’s a captcha as seen in [^leak-2]
35
-
This works by setting the width and hight of an embed so that only the target characters are shown,
36
-
this may use multiple embeds to change the order of the characters being displayed so that its harder for a user to know what infomation they're providing.
35
+
This works by setting the width and height of an embed so that only the target characters are shown,
36
+
this may use multiple embeds to change the order of the characters being displayed so that its harder for a user to know what information they're providing.
37
37
38
38
## Abusing autocomplete
39
39
If a website uses text inputs and does not opt-out of [autocomplete](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) using ```autocomplete="off"``` it may be possible to leak data such as email addresses by tricking the user into pressing the keys to navigate the autocomplete UI for a javascript focused text input.
The mitigation of this XS-Leak often varies depending on how applications handle certain resources. The general approach is to adopt consistent behaviors whereever possible. In specific scenarios, applications might use [Subresource Protections]({{< ref "/docs/defenses/design-protections/subresource-protections.md" >}}) to prevent attackers from predicting a URL and going forward with an attack.
51
+
The mitigation of this XS-Leak often varies depending on how applications handle certain resources. The general approach is to adopt consistent behaviors wherever possible. In specific scenarios, applications might use [Subresource Protections]({{< ref "/docs/defenses/design-protections/subresource-protections.md" >}}) to prevent attackers from predicting a URL and going forward with an attack.
52
52
53
53
Finally, without applying bigger changes in the logic of applications, generic web platform security features can be deployed to mitigate this XS-Leak at a larger scale.
Copy file name to clipboardExpand all lines: content/docs/attacks/navigations.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,9 +120,9 @@ setTimeout(() => {
120
120
## Server-Side Redirects
121
121
122
122
### Max redirects
123
-
When a page initiates a chain of 3XX redirects, browsers limit the maximum number of redirects to 20 [^spec-redirects]. This can be used to detect the exact number of redirects occured for a cross-origin page by following the below approach [^redirect-leak]:
123
+
When a page initiates a chain of 3XX redirects, browsers limit the maximum number of redirects to 20 [^spec-redirects]. This can be used to detect the exact number of redirects occurred for a cross-origin page by following the below approach [^redirect-leak]:
124
124
1. As a malicious website, initiate 19 redirects and make the final 20th redirect to the attacked page.
125
-
2. If the browser threw a network error, at least one redirect occured. Repeat the process with 18 redirects.
125
+
2. If the browser threw a network error, at least one redirect occurred. Repeat the process with 18 redirects.
126
126
3. If the browser didn't threw a network error, the number of redirects is known as `20 - issued_redirects`.
127
127
128
128
*To detect an error one can use [Error Events]({{< ref "/docs/attacks/error-events.md" >}})*
With the `performance` API it is possible to detect whether a resource was cached or not.
71
-
Unless [Cross-Origin Read Blocking]({{< ref "../../defenses/secure-defaults/corb.md" >}}) is triggered (resource is html) the resource will get cached in the processs of the check. [Run demo](https://xsinator.com/testing.html#Duration%20Redirect%20Leak)
71
+
Unless [Cross-Origin Read Blocking]({{< ref "../../defenses/secure-defaults/corb.md" >}}) is triggered (resource is html) the resource will get cached in the process of the check. [Run demo](https://xsinator.com/testing.html#Duration%20Redirect%20Leak)
Copy file name to clipboardExpand all lines: content/docs/defenses/isolation-policies/navigation-isolation.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Instead of rejecting all cross-site interactions, the user could be prompted to
16
16
17
17
## Implementation with Fetch Metadata
18
18
19
-
The below snippet showcases an example implemention of the Navigation Isolation Policy with the use of [Fetch Metadata]({{< ref "../opt-in/fetch-metadata.md">}}) headers [^secmetadata]:
19
+
The below snippet showcases an example implementation of the Navigation Isolation Policy with the use of [Fetch Metadata]({{< ref "../opt-in/fetch-metadata.md">}}) headers [^secmetadata]:
20
20
21
21
```py
22
22
# Reject cross-site requests to protect from clickjacking, XS-Leaks, and other bugs
Copy file name to clipboardExpand all lines: content/docs/defenses/isolation-policies/resource-isolation.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ Resource Isolation Policy prevents external websites from requesting your resour
12
12
13
13
## Implementation with Fetch Metadata
14
14
15
-
The below snippet showcases an example implemention of the Resource Isolation Policy with the use of [Fetch Metadata]({{< ref "../opt-in/fetch-metadata.md">}}) headers:
15
+
The below snippet showcases an example implementation of the Resource Isolation Policy with the use of [Fetch Metadata]({{< ref "../opt-in/fetch-metadata.md">}}) headers:
16
16
17
17
```py
18
18
# Reject cross-origin requests to protect from , XSSI, XS-Leaks, and other bugs
0 commit comments