-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Trusted Types: Prototype for hacking. #6457
Trusted Types: Prototype for hacking. #6457
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already reviewed downstream.
Firefox (nightly)Testing web-platform-tests at revision 048d9c4 All results11 tests ran/safe-html-types/SafeHTML.tentative.html
/safe-html-types/SafeURL.tentative.html
/safe-html-types/block-string-assignment-to-innerHTML.tentative.html
/safe-html-types/block-string-assignment-to-insertAdjacentHTML.tentative.html
/safe-html-types/block-string-assignment-to-location-href.tentative.html
/safe-html-types/block-string-assignment-to-outerHTML.tentative.html
/safe-html-types/document-write.tentative.html
/safe-html-types/innerHTML.tentative.html
/safe-html-types/insertAdjacentHTML.tentative.html
/safe-html-types/location-href.tentative.html
/safe-html-types/outerHTML.tentative.html
|
Sauce (safari)Testing web-platform-tests at revision 048d9c4 All results11 tests ran/safe-html-types/SafeHTML.tentative.html
/safe-html-types/SafeURL.tentative.html
/safe-html-types/block-string-assignment-to-innerHTML.tentative.html
/safe-html-types/block-string-assignment-to-insertAdjacentHTML.tentative.html
/safe-html-types/block-string-assignment-to-location-href.tentative.html
/safe-html-types/block-string-assignment-to-outerHTML.tentative.html
/safe-html-types/document-write.tentative.html
/safe-html-types/innerHTML.tentative.html
/safe-html-types/insertAdjacentHTML.tentative.html
/safe-html-types/location-href.tentative.html
/safe-html-types/outerHTML.tentative.html
|
Chrome (unstable)Testing web-platform-tests at revision 048d9c4 All results11 tests ran/safe-html-types/SafeHTML.tentative.html
/safe-html-types/SafeURL.tentative.html
/safe-html-types/block-string-assignment-to-innerHTML.tentative.html
/safe-html-types/block-string-assignment-to-insertAdjacentHTML.tentative.html
/safe-html-types/block-string-assignment-to-location-href.tentative.html
/safe-html-types/block-string-assignment-to-outerHTML.tentative.html
/safe-html-types/document-write.tentative.html
/safe-html-types/innerHTML.tentative.html
/safe-html-types/insertAdjacentHTML.tentative.html
/safe-html-types/location-href.tentative.html
/safe-html-types/outerHTML.tentative.html
|
Sauce (MicrosoftEdge)Testing web-platform-tests at revision 048d9c4 All results11 tests ran/safe-html-types/SafeHTML.tentative.html
/safe-html-types/SafeURL.tentative.html
/safe-html-types/block-string-assignment-to-innerHTML.tentative.html
/safe-html-types/block-string-assignment-to-insertAdjacentHTML.tentative.html
/safe-html-types/block-string-assignment-to-location-href.tentative.html
/safe-html-types/block-string-assignment-to-outerHTML.tentative.html
/safe-html-types/document-write.tentative.html
/safe-html-types/innerHTML.tentative.html
/safe-html-types/insertAdjacentHTML.tentative.html
/safe-html-types/location-href.tentative.html
/safe-html-types/outerHTML.tentative.html
|
2b59cde
to
16ae10f
Compare
(This isn't meant for review; it's meant for some discussion that could eventually lead to an explainer for even more discussion. Thanks for ignoring it!) |
16ae10f
to
3a0861d
Compare
3a0861d
to
b161a19
Compare
Build PASSEDStarted: 2017-09-20 11:46:59 View more information about this build on: |
b161a19
to
7f5f4d7
Compare
0bc2a97
to
16fee82
Compare
After talking with some folks about xtof's [1], I think there's something there that browsers are uniquely positioned to help out with. This patch starts sketching out what a set of safe types might look like, and what it might feel like for a developer to lock themselves out of raw string assignments to typical XSS sinks like `location.href` or `el.innerHTML`. This patch implements a first pass at `TrustedHTML` and `TrustedURL`, along with updates to a few sinks to use these new types. It's by no means a complete implementation, but should give us enough to play around with while we experiment with library authors to see how the layering might work. Explainer: https://github.com/mikewest/trusted-types Intent to Implement: https://groups.google.com/a/chromium.org/d/msg/blink-dev/qbOrXp9g3B8/hziymUnHAQAJ [1]: https://research.google.com/pubs/pub42934.html P.S. This patch looks huge and ugly, but the majority of the changes are the renamings of `set{Inner,Outer}HTML` that touch a million tests. Bug: 739170 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: I65e5add5cc7fcbc17f97ca8b737d7a3e1d8cad3b Reviewed-on: https://chromium-review.googlesource.com/559061 Commit-Queue: Mike West <mkwst@chromium.org> Reviewed-by: Yoav Weiss <yoav@yoav.ws> Cr-Commit-Position: refs/heads/master@{#503113}
16fee82
to
d1d335c
Compare
After talking with some folks about xtof's 1, I think there's something
there that browsers are uniquely positioned to help out with. This patch
starts sketching out what a set of safe types might look like, and what
it might feel like for a developer to lock themselves out of raw string
assignments to typical XSS sinks like
location.href
orel.innerHTML
.This patch implements a first pass at
TrustedHTML
andTrustedURL
,along with updates to a few sinks to use these new types. It's by no
means a complete implementation, but should give us enough to play
around with while we experiment with library authors to see how the
layering might work.
Explainer: https://github.com/mikewest/trusted-types
Intent to Implement: https://groups.google.com/a/chromium.org/d/msg/blink-dev/qbOrXp9g3B8/hziymUnHAQAJ
P.S. This patch looks huge and ugly, but the majority of the changes are
the renamings of
set{Inner,Outer}HTML
that touch a million tests.Bug: 739170
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I65e5add5cc7fcbc17f97ca8b737d7a3e1d8cad3b
Reviewed-on: https://chromium-review.googlesource.com/559061
Commit-Queue: Mike West mkwst@chromium.org
Reviewed-by: Yoav Weiss yoav@yoav.ws
Cr-Commit-Position: refs/heads/master@{#503113}