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

Add Subresource protections Article & Motivations for future defensive design article. #16

Merged
merged 17 commits into from
Sep 27, 2020
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion content/docs/defenses/design-protections/defensive-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ description = ""
date = "2020-07-21"
category = "defenses"
menu = "main"
bookHidden = true
+++

TODO
This section should focus on defensive design techniques used by companies to prevent XS-Leaks from happening. Some ideas:
manuelvsousa marked this conversation as resolved.
Show resolved Hide resolved

- The way applications they use iframes to display information based on a user query (search system)
manuelvsousa marked this conversation as resolved.
Show resolved Hide resolved
- How applications use Fetch Metadata with Vary headers to prevent cache probing attacks and what problems might occur with improper deployments. Are there any drawbacks of deploying this?
- How to ensure all application endpoints implement certain Headers to have the same behavior across different states.
empijei marked this conversation as resolved.
Show resolved Hide resolved
- Quick strategies to mitigate reported XS-Leaks, as a short-term solution before deploying web platform security features.
manuelvsousa marked this conversation as resolved.
Show resolved Hide resolved

If you want to contribute please check https://github.com/xsleaks/wiki/issues/17
Original file line number Diff line number Diff line change
@@ -1,9 +1,32 @@
+++
title = "Subresource Protections"
description = ""
description = "Subresources Protections"
date = "2020-07-21"
category = "defenses"
menu = "main"
+++

TODO
### Random tokens

One of the principles of protecting subresources is the same as protecting endpoints from [CSRF attacks](https://owasp.org/www-community/attacks/csrf). The difference from [CSRF protections](https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html) is that in the case of XS-Leaks, mostly GET requests are the ones worth protecting. To apply this protection, applications can append a (cryptographically strong) pseudorandom value, unique to each request/session, to make the URL of a subresource unpredictable to an attacker. The protection can be applied to the following types of subresources:
manuelvsousa marked this conversation as resolved.
Show resolved Hide resolved

- Authenticated subresources such as API endpoints or regular authenticated URLs. While pseudorandom values can be used in this case, security mitigations like [Same-Site Cookies](https://TODO) can be rather more effective.
manuelvsousa marked this conversation as resolved.
Show resolved Hide resolved
- Unauthenticated subresources such as images can use this protection to prevent some types of [Cache Probing Attacks](https://TODO). In this scenario, this protection can be highly effective.
empijei marked this conversation as resolved.
Show resolved Hide resolved
empijei marked this conversation as resolved.
Show resolved Hide resolved

### User Consent

Some applications might ask for user consent to trigger a certain sensitive action. Facebook deploys this protection in some sensible search endpoints like `https://www.facebook.com/messages/?qa=UserMustConsent`, where a user musk press OK to advance with the search query. Since attackers can't surpass this verification, the page won't leak any special behavior.
empijei marked this conversation as resolved.
Show resolved Hide resolved

## Deployment

While this protection might work in some scenarios, it has some disadvantages:

- Hard to deploy as it requires substantial changes in the codebase.
- It might break the desired behavior for the feature.
- In the case of Random tokens, it will break bookmarks and other permanent references.
empijei marked this conversation as resolved.
Show resolved Hide resolved

{{< hint warning >}}
This protection can be enough to fix attacks temporarily in certain scenarios. Due to the challenges of deploying this protection, applications are encouraged to deploy [opt-in web platform security features](https://TODO) as the default approach.
{{< /hint >}}