New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 791841 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 30
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Feature

Blocking:
issue 786673



Sign in to add a comment

Site Isolation: Prevent Cache manipulation via Cache API

Reported by s.h.h.n....@gmail.com, Dec 5 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36

Steps to reproduce the problem:
1. Download Chromium 61 (https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Mac/488533/)
2. Start with flag --site-per-process
3. Go to https://test.shhnjk.com/simple_service.html (Legit SW registration)
4. Go to https://shhnjk.azurewebsites.net/PoC2.php
5. Go to https://test.shhnjk.com/poison.html

What is the expected behavior?
Cache added by UXSS should be ignored (or disabled).

What went wrong?
Attacker with ability of UXSS can use Cache API even after Site Isolation is enabled. If victim site has service worker which intercepts the request and checks for existing cache, attacker can abuse this to inject arbitrary response with script which also has access to document.cookie. 

Did this work before? N/A 

Chrome version: 61.0.3163.0  Channel: n/a
OS Version: OS X 10.13.1
Flash Version:
 

Comment 1 by creis@chromium.org, Dec 5 2017

Blocking: 786673
Cc: creis@chromium.org nasko@chromium.org
Components: Internals>Sandbox>SiteIsolation
Thanks!  The Cache API will be a good case to add enforcements for, as we make progress on the full Site Isolation goals.  (There are several enforcements that aren't implemented yet, and they're being tracked in issue 786673.)
creis: Same question here - this seems potentially like a new security feature rather than bug? Should we change the Type to remove it from the sheriff queue?

Comment 3 by creis@chromium.org, Dec 5 2017

Labels: -Type-Bug-Security Type-Feature
Security feature.
If this is feature request rather than a bug, why are we hiding it? Can we open this up to public?
Labels: OS-Linux OS-Windows
Owner: creis@chromium.org
Status: Assigned (was: Unconfirmed)
Mac triage: assigning to creis@ for further triage.

Comment 6 by creis@chromium.org, Mar 21 2018

Cc: falken@chromium.org jam@chromium.org
Components: Blink>ServiceWorker Internals>Network>Cache
Labels: -Restrict-View-SecurityTeam
Summary: Site Isolation: Prevent Cache manipulation via Cache API (was: Site Isolation allows Cache manipulation via Cache API)
Ah, sorry, missed comment 4 amid all the activity in January.  Agreed this can be opened up, since Site Isolation isn't currently enforcing restrictions on fully compromised renderers yet.

falken@, any chance you know who works on the Cache API and may be able to help us find places to enforce this outside the renderer?  Also adding jam@, since I wonder if this is affected by the network service.

Comment 7 by dcheng@chromium.org, Mar 21 2018

Cc: jsb...@chromium.org cmumford@chromium.org
+jsbell, +cmumford for cache storage API

Comment 8 by mek@chromium.org, Mar 21 2018

Components: Blink>Storage>CacheStorage

Comment 9 by jsb...@chromium.org, Mar 21 2018

Cc: lucmult@chromium.org
Since Cache Storage hasn't been mojoified yet, appropriate checks on the browser side of classic IPC would be in:

https://cs.chromium.org/chromium/src/content/browser/cache_storage/cache_storage_dispatcher_host.cc

... but the mojoification is in flight:

https://chromium-review.googlesource.com/c/chromium/src/+/875510

... so probably best to wait until that lands (should be real soon!) and add it there.
This should be completely unblocked now...

Like (most) other mojo-ified back-ends the browser-side mojo channel / origin association occurs here:

https://cs.chromium.org/chromium/src/content/browser/renderer_interface_binders.cc?q=renderer_interface_binders.cc&dr&l=156

Which is used at:

https://cs.chromium.org/chromium/src/content/browser/renderer_interface_binders.cc?gsn=parameterized_binder_registry_&l=66

So if the frame->GetLastCommittedOrigin() is trustworthy then we're good. If not, that's a swell place to add enforcement. 
For every Mojo method called we use the origin from the initial binding (the one jsbell@ pointed on #10):
https://cs.chromium.org/chromium/src/content/browser/cache_storage/cache_storage_dispatcher_host.cc?l=244

This use of origin from binding-time is what guarantees the segregation of each origin's cache. 
Please add reward-topanel after this has been marked as fixed, so the VRP panel can take a look at it.
Owner: wanderview@chromium.org
Cc: wanderview@chromium.org
Owner: creis@chromium.org
Status: Fixed (was: Assigned)
Inspecting the code again, so far as I can tell this work was complete w/ lucmult@'s changes. We no longer rely on the renderer to inform what origin it is representing.

Passing back to creis@ to verify in case I missed something. Details in #10 - like most mojoified services, in RendererInterfaceBinders::BindInterface we rely on frame->GetLastCommittedOrigin() (for frames at least, for workers it's passed in) rather than anything passed by the renderer.

I tried verifying with the #0 steps, but unfortunately those resources don't seem to all be there any more.  The poison.html 404s.
Poison.html is a cache file created with UXSS. If you don’t have UXSS in hand, it will always return 404.
Could anyone add reward-topanel per Comment 12?
Labels: reward-topanel
Labels: -reward-topanel reward-0
Hi s.h.h.n.j.k@ - we had a discussion with the Site Isolation team about this bug, and we concluded that we would have fixed this even without the report, so we're not going to reward for it, I'm afraid.
All right! Thanks for the consideration!

Sign in to add a comment