New issue
Advanced search Search tips

Issue 852203 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 831073
Owner:
Closed: Jun 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug-Security



Sign in to add a comment

Cross-origin <a download> blocking bypass

Reported by s.h.h.n....@gmail.com, Jun 13 2018

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.79 Safari/537.36

Steps to reproduce the problem:
1. Go to https://test.shhnjk.com/download_bypass.html

What is the expected behavior?
Navigation is triggered.

What went wrong?
Download can be triggered for cross-origin <a download> with redirect (which is usually blocked by https://www.chromestatus.com/feature/4969697975992320).

This also sends SameSite Lax cookie. Maybe Downloads are considered as top-level navigation? Needs Mike to decide what should happen on cross-origin downloads.

Did this work before? N/A 

Chrome version: 67.0.3396.79  Channel: n/a
OS Version: 10.0
Flash Version:
 
>Needs Mike to decide what should happen on cross-origin downloads.
I meant *cross-site* downloads. Since I'm talking about SameSite cookie.

Comment 2 by wfh@chromium.org, Jun 13 2018

Components: Blink>SecurityFeature
Owner: mkwst@chromium.org
Status: assigned (was: Unconfirmed)
Thanks for the report.

This report does not contain enough detail for me to know whether this is a request for a new security feature (which would be type=bug, component=security) or an actual issue that affects user security.

Sounds like this is already something that has been discussed with mike so assigning to him to triage and, if appropriate, remove from security queue.
>This report does not contain enough detail for me to know whether this is a
>request for a new security feature (which would be type=bug, component=security)
>or an actual issue that affects user security.
:( Let me try again...
Cross-origin <a download> blocking (https://www.chromestatus.com/feature/4969697975992320) is a security feature in Chrome (per Blink component), which aims to block attacks which takes advantage of an ability to force download of cross-origin content which is not intented to be downloaded.

One of those attacks is Reflected File Download, which abuses user's trust on certain domain and ability for attacker to host or inject attacker controlled payload to trusted domain.

Real world example:
The domain http://dl.profile.line.naver.jp is owned by Line Corp and is trusted by user. But attacker has an ability to upload profile picture to this domain. Abusing profile picture and Cross-origin <a download> blocking bypass, attacker can craft an image which is also valid as HTML, and force download this picture as an HTML file so that victim opens it up (because it came from trusted domain, right?).

PoC:
https://test.shhnjk.com/force_rfd.html


SameSite cookie part:
SameSite cookie spec is unclear (at least for me) on whether download should be considered as a top-level navigation or not. If it shouldn't be considered as a top-level navigation, then this is a SameSite Lax cookie bypass. But since it's unclear to me, I need Mike's opinion on this (where are you Mike) :)

PS
I love precise report so I always try to make my report as small as possible.

Comment 4 by mkwst@chromium.org, Jun 14 2018

Owner: jochen@chromium.org
+Jochen for the `<a download>` bit, as he's been pushing on that recently. I don't know what the expectations are for redirects in that chain.

For the `SameSite` bit, we did intentionally chose to send `SameSite=Lax` cookies along for the ride if the download is triggered from the top-level document (because downloads ~are navigations that end up not navigating, and it seemed likely that folks might have separate servers for downloads, potentially gated on auth cookies). That assumption may be out-of-date now that Jochen's been poking at the underlying mechanics of downloads.

Comment 5 by jochen@chromium.org, Jun 14 2018

Mergedinto: 831073
Status: Duplicate (was: Assigned)
mkwst@, can we convert this bug to SameSite cookie bug instead?

>For the `SameSite` bit, we did intentionally chose to send `SameSite=Lax`
>cookies along for the ride if the download is triggered from the 
>top-level document

SameSite Lax cookie is sent even if download is triggered from frames.

Repro steps:
1. Go to https://test.shhnjk.com/SameSite.php (this sets SameSite cookies)
2. Now go to https://shhnjk.azurewebsites.net/iframer.php?url=download_redirect.html

Observe that downloaded file contains "Received Lax!".
Project Member

Comment 7 by sheriffbot@chromium.org, Sep 20

Labels: -Restrict-View-SecurityTeam allpublic
This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment