Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Issue 1011103002: Allow cross-origin cssRules access to CORS-fetched stylesheet. (Closed)

Created:
5 years, 9 months ago by sof
Modified:
5 years, 9 months ago
Reviewers:
Nate Chapin, Mike West
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, blink-reviews-html_chromium.org, blink-reviews-style_chromium.org, dglazkov+blink, ed+blinkwatch_opera.com, gavinp+prerender_chromium.org, rwlbuis, Yoav Weiss
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Allow cross-origin cssRules access to CORS-fetched stylesheet. When accessing the cssRules property on CSSStyleSheet an origin check is performed for non-inline stylesheets. Should that stylesheet have been loaded from another origin following CORS, the access ought to be permitted, but wasn't. Address by having the link element (LinkStyle) record if the stylesheet it creates was successfully fetched using CORS. If it was, the stylesheet access check will succeed. R=mkwst BUG=467672 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=192066

Patch Set 1 #

Patch Set 2 : non-oilpan compile fix #

Patch Set 3 : Restrict further; have stylesheet record CORS-successful origin #

Patch Set 4 : improve test coverage a bit #

Total comments: 4

Patch Set 5 : remove redundant canRequest() check #

Patch Set 6 : compile fix.. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+124 lines, -47 lines) Patch
M LayoutTests/http/tests/security/link-crossorigin-stylesheet-anonymous.html View 1 chunk +2 lines, -2 lines 0 comments Download
A + LayoutTests/http/tests/security/link-crossorigin-stylesheet-import-anonymous.html View 1 2 2 chunks +7 lines, -6 lines 0 comments Download
A + LayoutTests/http/tests/security/link-crossorigin-stylesheet-import-anonymous-expected.txt View 1 2 2 chunks +1 line, -2 lines 0 comments Download
A + LayoutTests/http/tests/security/link-crossorigin-stylesheet-import-credentials.html View 1 2 3 2 chunks +8 lines, -8 lines 0 comments Download
A + LayoutTests/http/tests/security/link-crossorigin-stylesheet-import-credentials-expected.txt View 1 2 3 2 chunks +1 line, -2 lines 0 comments Download
M LayoutTests/http/tests/security/link-crossorigin-stylesheet-no-cors.html View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/http/tests/security/link-crossorigin-stylesheet-use-credentials.html View 3 chunks +4 lines, -4 lines 0 comments Download
A + LayoutTests/http/tests/security/resources/green-background-allow-credentials-import.php View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
A + LayoutTests/http/tests/security/resources/green-background-allow-star-import.php View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
A LayoutTests/http/tests/security/resources/green-background-import-anonymous.css View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
A LayoutTests/http/tests/security/resources/green-background-import-credentials.css View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
A LayoutTests/http/tests/security/resources/green-if-cors-anonymous.php View 1 2 3 1 chunk +15 lines, -0 lines 0 comments Download
A + LayoutTests/http/tests/security/resources/green-if-cors-credentialed.php View 1 2 3 1 chunk +5 lines, -7 lines 0 comments Download
M LayoutTests/http/tests/security/resources/link-crossorigin-common.js View 1 2 3 2 chunks +39 lines, -10 lines 0 comments Download
A + LayoutTests/http/tests/security/resources/red-background.css View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M Source/core/css/CSSStyleSheet.h View 1 2 3 chunks +5 lines, -0 lines 0 comments Download
M Source/core/css/CSSStyleSheet.cpp View 1 2 2 chunks +7 lines, -0 lines 0 comments Download
M Source/core/html/HTMLLinkElement.h View 1 2 3 4 1 chunk +8 lines, -0 lines 0 comments Download
M Source/core/html/HTMLLinkElement.cpp View 1 2 3 4 5 5 chunks +16 lines, -1 line 0 comments Download

Messages

Total messages: 8 (3 generated)
sof
Please take a look. Enables cross-origin script access to these stylesheets, so we need to ...
5 years, 9 months ago (2015-03-17 17:03:09 UTC) #2
Mike West
LGTM % comments. Thanks! https://codereview.chromium.org/1011103002/diff/60001/Source/core/html/HTMLLinkElement.cpp File Source/core/html/HTMLLinkElement.cpp (right): https://codereview.chromium.org/1011103002/diff/60001/Source/core/html/HTMLLinkElement.cpp#newcode684 Source/core/html/HTMLLinkElement.cpp:684: if (!m_owner->document().securityOrigin()->canRequest(baseURL)) I'm not sure ...
5 years, 9 months ago (2015-03-17 20:05:46 UTC) #3
sof
Thanks for finding the time for the careful review. https://codereview.chromium.org/1011103002/diff/60001/Source/core/html/HTMLLinkElement.cpp File Source/core/html/HTMLLinkElement.cpp (right): https://codereview.chromium.org/1011103002/diff/60001/Source/core/html/HTMLLinkElement.cpp#newcode684 Source/core/html/HTMLLinkElement.cpp:684: ...
5 years, 9 months ago (2015-03-17 21:52:15 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1011103002/100001
5 years, 9 months ago (2015-03-18 07:28:11 UTC) #7
commit-bot: I haz the power
5 years, 9 months ago (2015-03-18 07:31:16 UTC) #8
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=192066

Powered by Google App Engine
This is Rietveld 408576698