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

Issue 2531163004: Remove attributes that contain javascript from MHTML (Closed)

Created:
4 years ago by jianli
Modified:
3 years, 8 months ago
CC:
blink-reviews, blink-reviews-dom_chromium.org, chromium-reviews, dcheng, dglazkov+blink, Dmitry Titov, eae+blinkwatch, kinuko+watch, mlamouri+watch-blink_chromium.org, rwlbuis, sof
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove attributes that contain javascript from MHTML We remove the following attributes that could contain javascript since they will not work from fully sandboxed MHTML loading: 1) Any event handler attribute 2) Any attribute that can contain a URI will be executed as Javascript 3) Any attribute of SVG elements that can contain Javascript BUG=669325 TEST=new tests added Committed: https://crrev.com/52a4d5c0fa88e881003e2f352c4de4f294257529 Cr-Commit-Position: refs/heads/master@{#435811}

Patch Set 1 #

Total comments: 11

Patch Set 2 : Address feedback #

Total comments: 2

Patch Set 3 : Add positive tests #

Total comments: 2

Patch Set 4 : Fix #

Total comments: 2

Patch Set 5 : Address final feedback #

Messages

Total messages: 38 (24 generated)
jianli
4 years ago (2016-11-29 02:03:49 UTC) #3
Łukasz Anforowicz
Overall change LGTM, but I think we might want to be careful about the new ...
4 years ago (2016-11-29 18:59:55 UTC) #8
dcheng
+tkent, would you mind doing the Blink review for this?
4 years ago (2016-11-29 21:11:49 UTC) #10
jianli
https://codereview.chromium.org/2531163004/diff/1/third_party/WebKit/Source/core/dom/Element.h File third_party/WebKit/Source/core/dom/Element.h (right): https://codereview.chromium.org/2531163004/diff/1/third_party/WebKit/Source/core/dom/Element.h#newcode479 third_party/WebKit/Source/core/dom/Element.h:479: // Returns true is the given attribute is an ...
4 years ago (2016-11-30 00:46:26 UTC) #11
carlosk
Indeed this new version does look better. LGTM with one observation. https://codereview.chromium.org/2531163004/diff/40001/third_party/WebKit/Source/web/tests/WebFrameSerializerTest.cpp File third_party/WebKit/Source/web/tests/WebFrameSerializerTest.cpp (right): ...
4 years ago (2016-11-30 01:03:16 UTC) #15
jianli
https://codereview.chromium.org/2531163004/diff/40001/third_party/WebKit/Source/web/tests/WebFrameSerializerTest.cpp File third_party/WebKit/Source/web/tests/WebFrameSerializerTest.cpp (right): https://codereview.chromium.org/2531163004/diff/40001/third_party/WebKit/Source/web/tests/WebFrameSerializerTest.cpp#newcode209 third_party/WebKit/Source/web/tests/WebFrameSerializerTest.cpp:209: EXPECT_EQ(std::string::npos, mhtml.find("javascript:")); On 2016/11/30 01:03:16, carlosk wrote: > I ...
4 years ago (2016-11-30 01:35:37 UTC) #16
tkent
The code change looks ok, however does this mean save-page-as-complete-html and save-page-as-mhtml have different user-visible ...
4 years ago (2016-11-30 08:10:17 UTC) #22
jianli
save-page-as-complete-html and save-page-as-mhtml are indeed treated differently in loading. The former one allows script execution ...
4 years ago (2016-12-01 01:52:35 UTC) #23
tkent
I'm not sure if the behavior change is good for users, but anyway the code ...
4 years ago (2016-12-01 14:53:10 UTC) #28
jianli
https://codereview.chromium.org/2531163004/diff/80001/third_party/WebKit/Source/web/tests/WebFrameSerializerTest.cpp File third_party/WebKit/Source/web/tests/WebFrameSerializerTest.cpp (right): https://codereview.chromium.org/2531163004/diff/80001/third_party/WebKit/Source/web/tests/WebFrameSerializerTest.cpp#newcode206 third_party/WebKit/Source/web/tests/WebFrameSerializerTest.cpp:206: EXPECT_EQ(std::string::npos, mhtml.find("onload=")); On 2016/12/01 14:53:10, tkent wrote: > The ...
4 years ago (2016-12-01 23:03:56 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2531163004/100001
4 years ago (2016-12-01 23:04:34 UTC) #32
jianli
On 2016/12/01 14:53:10, tkent wrote: > I'm not sure if the behavior change is good ...
4 years ago (2016-12-01 23:59:24 UTC) #33
commit-bot: I haz the power
Committed patchset #5 (id:100001)
4 years ago (2016-12-02 01:38:51 UTC) #36
commit-bot: I haz the power
4 years ago (2016-12-02 01:42:10 UTC) #38
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/52a4d5c0fa88e881003e2f352c4de4f294257529
Cr-Commit-Position: refs/heads/master@{#435811}

Powered by Google App Engine
This is Rietveld 408576698