WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
92649
[Qt] REGRESSION http/tests/security/contentSecurityPolicy/object-src-none-blocked.html fails after
r123978
https://bugs.webkit.org/show_bug.cgi?id=92649
Summary
[Qt] REGRESSION http/tests/security/contentSecurityPolicy/object-src-none-blo...
Zoltan Arvai
Reported
2012-07-30 07:57:43 PDT
http/tests/security/contentSecurityPolicy/object-src-none-blocked.html fails after
r123978
--- /ramdisk/qt-linux-release/build/layout-test-results/http/tests/security/contentSecurityPolicy/object-src-none-blocked-expected.txt +++ /ramdisk/qt-linux-release/build/layout-test-results/http/tests/security/contentSecurityPolicy/object-src-none-blocked-actual.txt @@ -1,3 +1,5 @@ +CONSOLE MESSAGE: Refused to load the object 'data:application/x-webkit-test-netscape,logifloaded' because it violates the following Content Security Policy directive: "object-src 'none'". + CONSOLE MESSAGE: Refused to load the object 'data:application/x-webkit-test-netscape,logifloaded' because it violates the following Content Security Policy directive: "object-src 'none'".
Attachments
Patch
(10.39 KB, patch)
2012-08-03 06:49 PDT
,
Mike West
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Mike West
Comment 1
2012-07-30 08:01:51 PDT
The diff looks correct, sorry for not checking the other ports before landing. I'll fix it tonight when I'm back in front of a computer.
Csaba Osztrogonác
Comment 2
2012-07-30 08:18:38 PDT
Why
r123978
caused this duplicated console message?
Zoltan Arvai
Comment 3
2012-07-30 08:24:35 PDT
Problem exist on Qt5, too. http/tests/security/contentSecurityPolicy/object-src-none-blocked.html test makes http/tests/security/xss-DENIED-xsl-document-securityOrigin.xml fail after the commit
r123978
. Before this commit it had no problem with "logifloaded". --- /ramdisk/qt-linux-release/build/layout-test-results/http/tests/security/xss-DENIED-xsl-document-securityOrigin-expected.txt +++ /ramdisk/qt-linux-release/build/layout-test-results/http/tests/security/xss-DENIED-xsl-document-securityOrigin-actual.txt @@ -1,3 +1,5 @@ +CONSOLE MESSAGE: Refused to load the object 'data:application/x-webkit-test-netscape,logifloaded' because it violates the following Content Security Policy directive: "object-src 'none'". + CONSOLE MESSAGE: Unsafe JavaScript attempt to access frame with URL
http://localhost:8080/security/resources/innocent-victim.html
from frame with URL about:blank. Domains, protocols and ports must match. -This test passes if it doesn't alert the contents of innocent-victim.html. +This test passes if it doesn't alert the contents of innocent-victim.html.
Zoltan Arvai
Comment 4
2012-07-30 08:51:17 PDT
Test skipped on Qt in
http://trac.webkit.org/changeset/124030
. Please unskip it with the proper fix.
Mike West
Comment 5
2012-07-31 08:55:22 PDT
(In reply to
comment #2
)
> Why
r123978
caused this duplicated console message?
I spoke too quickly; I didn't see that the console message was being duplicated. That diff makes no sense.
Csaba Osztrogonác
Comment 6
2012-07-31 09:54:24 PDT
Great, skipping a test made another one fail, but only on WK2: --- /home/webkitbuildbot/slaves/release64bitWebKit2_EC2/buildslave/qt-linux-64-release-webkit2/build/layout-test-results/http/tests/security/contentSecurityPolicy/object-src-no-url-blocked-expected.txt +++ /home/webkitbuildbot/slaves/release64bitWebKit2_EC2/buildslave/qt-linux-64-release-webkit2/build/layout-test-results/http/tests/security/contentSecurityPolicy/object-src-no-url-blocked-actual.txt @@ -1,3 +1,5 @@ +CONSOLE MESSAGE: Refused to load the object '' because it violates the following Content Security Policy directive: "object-src 'none'". + CONSOLE MESSAGE: Refused to load the object '' because it violates the following Content Security Policy directive: "object-src 'none'". This test passes if there is a console message saying the plugin was blocked.
Mike West
Comment 7
2012-08-02 13:34:42 PDT
Merging 92963 into this bug. Adam suggested that async console logs from one test might be leaking into the next. This could certainly be the case, given that plugin loading is wonky. I'll post a patch in a moment that adds delays and see how it goes. If it fixes the issues, I'll unskip the tests on the various ports.
Mike West
Comment 8
2012-08-02 13:35:41 PDT
***
Bug 92963
has been marked as a duplicate of this bug. ***
Mike West
Comment 9
2012-08-03 06:49:23 PDT
Created
attachment 156356
[details]
Patch
Mike West
Comment 10
2012-08-03 06:52:59 PDT
This is a bit of a mess. Console messages are leaking into the next test, partially because we're generating more messages than we should when blocking plugins via Content Security Policy. The attached patch adds a new PluginUnavailabilityReason, and marks the plugin element's renderer as unavailable when CSP blocks the plugin. This should prevent additional console messages from being generated, and works in my local testing (NRWT, running each test in the `security/contentSecurityPolicy` directory 20 times). WDYT, Jochen and Adam?
jochen
Comment 11
2012-08-03 06:59:00 PDT
Comment on
attachment 156356
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=156356&action=review
> Source/WebCore/loader/SubframeLoader.cpp:-130 > - return false;
I assume you removed this check because you don't have a renderer yet at this point? Are there code paths that go through requestPlugin but never loadPlugin?
Mike West
Comment 12
2012-08-03 07:06:47 PDT
Comment on
attachment 156356
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=156356&action=review
>> Source/WebCore/loader/SubframeLoader.cpp:-130 >> - return false; > > I assume you removed this check because you don't have a renderer yet at this point? > > Are there code paths that go through requestPlugin but never loadPlugin?
Right. Since someone already called out the dependence on renderer in loadPlugin as an issue, I decided that introducing it in another method would be a bad idea. loadPlugin and requestPlugin are both private methods of SubframeLoader, and so far as I can tell, loadPlugin is only called inside SubframeLoader from requestPlugin. Removing this check here seems safe.
Mike West
Comment 13
2012-08-03 08:59:51 PDT
***
Bug 92956
has been marked as a duplicate of this bug. ***
Mike West
Comment 14
2012-08-03 09:01:17 PDT
***
Bug 91379
has been marked as a duplicate of this bug. ***
Adam Barth
Comment 15
2012-08-03 09:14:07 PDT
Comment on
attachment 156356
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=156356&action=review
>>> Source/WebCore/loader/SubframeLoader.cpp:-130 >>> - return false; >> >> I assume you removed this check because you don't have a renderer yet at this point? >> >> Are there code paths that go through requestPlugin but never loadPlugin? > > Right. Since someone already called out the dependence on renderer in loadPlugin as an issue, I decided that introducing it in another method would be a bad idea. > > loadPlugin and requestPlugin are both private methods of SubframeLoader, and so far as I can tell, loadPlugin is only called inside SubframeLoader from requestPlugin. Removing this check here seems safe.
Is the isSandboxed(SandboxPlugins) needed? Should we add an ASSERT?
Mike West
Comment 16
2012-08-03 09:26:26 PDT
(In reply to
comment #15
)
> (From update of
attachment 156356
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=156356&action=review
> > >>> Source/WebCore/loader/SubframeLoader.cpp:-130 > >>> - return false; > >> > >> I assume you removed this check because you don't have a renderer yet at this point? > >> > >> Are there code paths that go through requestPlugin but never loadPlugin? > > > > Right. Since someone already called out the dependence on renderer in loadPlugin as an issue, I decided that introducing it in another method would be a bad idea. > > > > loadPlugin and requestPlugin are both private methods of SubframeLoader, and so far as I can tell, loadPlugin is only called inside SubframeLoader from requestPlugin. Removing this check here seems safe. > > Is the isSandboxed(SandboxPlugins) needed? Should we add an ASSERT?
I don't see another check for SandboxPlugins in SubframeLoader or in HTML{Object,Embed}Element. We could move that check to loadPlugin if you'd like? Moving some of these check out into HTMLXXXElement might very well make sense. I'm happy to do that, but I'd suggest doing it in a separate patch, as it's cleanup that's somewhat tangential to this bug.
Adam Barth
Comment 17
2012-08-03 10:19:32 PDT
Comment on
attachment 156356
[details]
Patch Ok. In general, these two checks should be right next to each other since they're doing very similar things, but we can clean that up in a later patch.
Mike West
Comment 18
2012-08-03 10:29:21 PDT
Comment on
attachment 156356
[details]
Patch I've filed a bug to follow up on the cleanup. Would you mind CQing this in the meantime?
Mike West
Comment 19
2012-08-03 10:30:39 PDT
(In reply to
comment #18
)
> (From update of
attachment 156356
[details]
) > I've filed a bug to follow up on the cleanup. Would you mind CQing this in the meantime?
web.it/93138
Adam Barth
Comment 20
2012-08-03 10:32:11 PDT
boom
WebKit Review Bot
Comment 21
2012-08-03 12:14:26 PDT
Comment on
attachment 156356
[details]
Patch Clearing flags on attachment: 156356 Committed
r124636
: <
http://trac.webkit.org/changeset/124636
>
WebKit Review Bot
Comment 22
2012-08-03 12:14:33 PDT
All reviewed patches have been landed. Closing bug.
Mike West
Comment 23
2012-08-04 15:18:38 PDT
***
Bug 77556
has been marked as a duplicate of this bug. ***
Mike West
Comment 24
2012-08-04 15:20:19 PDT
***
Bug 71906
has been marked as a duplicate of this bug. ***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug