WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
REOPENED
43891
location.href does not throw SECURITY_ERR when accessed across origins with JSC bindings
https://bugs.webkit.org/show_bug.cgi?id=43891
Summary
location.href does not throw SECURITY_ERR when accessed across origins with J...
Mihai Parparita
Reported
2010-08-11 18:32:43 PDT
See
bug 43504
for details and test case. This is about fixing the JSC bindings.
Attachments
Patch
(15.00 KB, patch)
2010-08-12 17:36 PDT
,
Mihai Parparita
no flags
Details
Formatted Diff
Diff
Patch
(28.93 KB, patch)
2013-02-04 04:00 PST
,
Mike West
no flags
Details
Formatted Diff
Diff
Patch
(31.32 KB, patch)
2013-02-04 06:00 PST
,
Mike West
no flags
Details
Formatted Diff
Diff
Patch for landing
(31.48 KB, patch)
2013-02-13 02:36 PST
,
Mike West
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Mihai Parparita
Comment 1
2010-08-12 17:36:18 PDT
Created
attachment 64286
[details]
Patch
Mihai Parparita
Comment 2
2010-08-12 17:48:33 PDT
Sam/Adam/Maciej: Since you have either reviewed or made security-relate changes to the location object in the past (
r44135
,
r48619
,
r51757
), could one of you take a look at this (there's more details at the parent
bug 43504
)? (I'm not looking to land this until the V8 side is sorted out too, that's in
bug 43892
).
Adam Barth
Comment 3
2010-08-12 17:52:14 PDT
Comment on
attachment 64286
[details]
Patch
> Gecko and IE do throw the exception.
Can you add this information (and the spec reference) to the ChangeLog? Generally, it's helpful if the ChangeLog explains why we're making these changes without having to hunt through the bug database. Otherwise, looks good. Thanks!
Sam Weinig
Comment 4
2010-08-12 17:58:23 PDT
We have historically not thrown in these cases. If we want to move to throwing on cross-origin errors I would prefer to discuss it in a more general forum.
Mihai Parparita
Comment 5
2010-08-12 18:00:07 PDT
(In reply to
comment #4
)
> We have historically not thrown in these cases. If we want to move to throwing on cross-origin errors I would prefer to discuss it in a more general forum.
Sure, should I start a thread on webkit-dev@ or is there a more appropriate forum? (I'd also be curious about the historical reasons, since
http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#security-location
is pretty explicit about the error being thrown).
Adam Barth
Comment 6
2010-08-12 18:19:06 PDT
Comment on
attachment 64286
[details]
Patch Clearing the review flag based on the above discussion.
Sam Weinig
Comment 7
2010-08-12 19:08:02 PDT
(In reply to
comment #5
)
> (In reply to
comment #4
) > > We have historically not thrown in these cases. If we want to move to throwing on cross-origin errors I would prefer to discuss it in a more general forum. > > Sure, should I start a thread on webkit-dev@ or is there a more appropriate forum? (I'd also be curious about the historical reasons, since
http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#security-location
is pretty explicit about the error being thrown).
webkit-dev is fine. There are two parts to why this is the current case. 1) We are generally weary of throwing exceptions. 2) There was no specification on cross-origin violations when we implemented our checks.
Mihai Parparita
Comment 8
2010-08-12 20:08:50 PDT
(In reply to
comment #7
)
> webkit-dev is fine. There are two parts to why this is the current case. 1) We are generally weary of throwing exceptions. 2) There was no specification on cross-origin violations when we implemented our checks.
OK, just emailed webkit-dev. Thanks for the background information.
Kyle Adams
Comment 9
2011-06-15 18:23:48 PDT
Just wondering if there was any update on this issue. I followed the thread on webkit-dev and it never seemed to come to any sort of consensus. We're also seeing the error show up on SourceForge for many of the ads, which is annoying when trying to track down real ad issues.
Adam Barth
Comment 10
2011-06-15 18:44:45 PDT
(In reply to
comment #9
)
> Just wondering if there was any update on this issue. I followed the thread on webkit-dev and it never seemed to come to any sort of consensus. We're also seeing the error show up on SourceForge for many of the ads, which is annoying when trying to track down real ad issues.
Re-reading the thread, it seems like folks aren't that enthusiastic about changing our behavior unless there's a compatibility reason to change. This is the kind of change that can cause compatibility problems (in either direction). Personally, I think throwing would be slightly better, but I don't feel that strongly about it.
Kyle Adams
Comment 11
2011-06-16 06:39:59 PDT
In my reading of the thread it seemed like there was a disconnect between the webkit devs and the folks who are enthusiastic about seeing it fixed. In particular, if you look at the Chromium bug (
http://crbug/17325
), there are a several replies to Mihai's request for real world examples at the end. Those have to be combined with some of the other real world problems (FCKEditor, Google Talk, etc.) mentioned in the thread for a more accurate picture of interest. The compatibility argument doesn't seem particularly strong given that catching the error is what IE and Firefox already do.
Kyle Adams
Comment 12
2011-06-16 06:40:58 PDT
(In reply to
comment #11
)
> The compatibility argument doesn't seem particularly strong given that catching the error is what IE and Firefox already do.
Or more accurately, compatibility seems to argue in favor of fixing this rather than ignoring it :-)
Adam Barth
Comment 13
2011-06-16 10:37:06 PDT
> In my reading of the thread it seemed like there was a disconnect between the webkit devs and the folks who are enthusiastic about seeing it fixed.
Yes. :)
> In particular, if you look at the Chromium bug (
http://crbug/17325
), there are a several replies to Mihai's request for real world examples at the end.
Those seem to be that folks at Sprout and Facebook have run into this problem and worked around it somehow (or just their sites work less well in WebKit-based browsers).
> The compatibility argument doesn't seem particularly strong given that catching the error is what IE and Firefox already do.
Generally, we like to align our behavior with IE and Firefox. You make a good case. Maybe we should give this a try and see if it causes problems.
Mihai Parparita
Comment 14
2011-06-16 14:16:52 PDT
I agree that (In reply to
comment #13
)
> You make a good case. Maybe we should give this a try and see if it causes problems.
I agree that this is worth trying, but I won't have time to resurrect my patch, so I'm leaving this up for grabs.
Mike West
Comment 15
2012-09-28 00:39:05 PDT
Grabbing this as part of my nacient error message cleanup extravaganza.
David Levin
Comment 16
2012-09-28 01:21:14 PDT
(In reply to
comment #9
)
> Just wondering if there was any update on this issue. I followed the thread on webkit-dev and it never seemed to come to any sort of consensus. We're also seeing the error show up on SourceForge for many of the ads, which is annoying when trying to track down real ad issues.
Kyle, you may find ancestorOrigins useful (
http://trac.webkit.org/changeset/113945
). It helps in some of these scenarios but not all of course.
Mike West
Comment 17
2013-02-04 04:00:55 PST
Created
attachment 186342
[details]
Patch
Build Bot
Comment 18
2013-02-04 04:43:32 PST
Comment on
attachment 186342
[details]
Patch
Attachment 186342
[details]
did not pass mac-ews (mac): Output:
http://queues.webkit.org/results/16367223
New failing tests: http/tests/security/sandboxed-iframe-blocks-access-from-parent.html
Build Bot
Comment 19
2013-02-04 05:32:15 PST
Comment on
attachment 186342
[details]
Patch
Attachment 186342
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://queues.webkit.org/results/16371202
New failing tests: http/tests/security/sandboxed-iframe-blocks-access-from-parent.html
Build Bot
Comment 20
2013-02-04 05:40:18 PST
Comment on
attachment 186342
[details]
Patch
Attachment 186342
[details]
did not pass win-ews (win): Output:
http://queues.webkit.org/results/16378092
Mike West
Comment 21
2013-02-04 06:00:07 PST
Created
attachment 186362
[details]
Patch
Adam Barth
Comment 22
2013-02-06 12:47:07 PST
Comment on
attachment 186362
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=186362&action=review
> Source/WebCore/ChangeLog:25 > + This is the JSC half of the patch. V8 is coming in
http://wkbug.com/43892
Perhaps we should have an ENABLE flag for this change in behavior since we have some reason to believe it comes with compatibility risks.
Mike West
Comment 23
2013-02-07 02:27:18 PST
(In reply to
comment #22
)
> (From update of
attachment 186362
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=186362&action=review
> > > Source/WebCore/ChangeLog:25 > > + This is the JSC half of the patch. V8 is coming in
http://wkbug.com/43892
> > Perhaps we should have an ENABLE flag for this change in behavior since we have some reason to believe it comes with compatibility risks.
Do we? The claim made here is that the web must already be checking for thrown exceptions, as that's what other major vendors seem to be doing already. Spot checks against a few ad servers line up with this assumption. I don't think an ENABLE flag is necessary, but I'll certainly add it if you disagree.
Adam Barth
Comment 24
2013-02-07 11:03:02 PST
> Do we? The claim made here is that the web must already be checking for thrown exceptions, as that's what other major vendors seem to be doing already. Spot checks against a few ad servers line up with this assumption.
My worry is more about non-web uses of WebKit, such as by Mac Apps and Dashboard widgets. The change is very localized, so I guess it will be easy to revisit if we do run into compat problems.
Adam Barth
Comment 25
2013-02-07 11:04:05 PST
Comment on
attachment 186362
[details]
Patch I would wait until Tuesday to land the V8 side of this patch for the same reason as the nosniff patch: that will give us a full Dev cycle to find compat problems before the change is promoted to Beta.
Mike West
Comment 26
2013-02-07 11:22:35 PST
(In reply to
comment #25
)
> (From update of
attachment 186362
[details]
) > I would wait until Tuesday to land the V8 side of this patch for the same reason as the nosniff patch: that will give us a full Dev cycle to find compat problems before the change is promoted to Beta.
I'm happy to wait, thanks for the review.
Mike West
Comment 27
2013-02-13 02:36:41 PST
Created
attachment 188038
[details]
Patch for landing
Mike West
Comment 28
2013-02-13 02:39:27 PST
(In reply to
comment #27
)
> Created an attachment (id=188038) [details] > Patch for landing
Chromium has branched; I'll go ahead and land the JSC side now, and work with the V8 folks to being the Chromium side to parity in
http://wkbug.com/43892
WebKit Review Bot
Comment 29
2013-02-13 03:20:48 PST
Comment on
attachment 188038
[details]
Patch for landing Clearing flags on attachment: 188038 Committed
r142734
: <
http://trac.webkit.org/changeset/142734
>
WebKit Review Bot
Comment 30
2013-02-13 03:20:53 PST
All reviewed patches have been landed. Closing bug.
Geoffrey Garen
Comment 31
2013-02-16 08:13:43 PST
This patch seems to have caused a crash:
https://bugs.webkit.org/show_bug.cgi?id=110017
.
WebKit Review Bot
Comment 32
2013-02-16 08:28:29 PST
Re-opened since this is blocked by
bug 110018
Geoffrey Garen
Comment 33
2013-02-16 14:24:44 PST
The ASSERT in
bug 109838
might explain why this was crashing -- it seems that, in at least one code path, if this exception is thrown, it is never processed by the VM.
Mike West
Comment 34
2013-02-20 06:49:12 PST
(In reply to
comment #33
)
> The ASSERT in
bug 109838
might explain why this was crashing -- it seems that, in at least one code path, if this exception is thrown, it is never processed by the VM.
:( I'm not having much luck constructing a layout test that crashes. Likewise, running the relevant existing layout tests 10000 times hasn't produced a single crash locally. I'd appreciate some help tracking this down. :)
Maciej Stachowiak
Comment 35
2013-03-06 01:46:29 PST
(In reply to
comment #34
)
> (In reply to
comment #33
) > > The ASSERT in
bug 109838
might explain why this was crashing -- it seems that, in at least one code path, if this exception is thrown, it is never processed by the VM. > > :( > > I'm not having much luck constructing a layout test that crashes. Likewise, running the relevant existing layout tests 10000 times hasn't produced a single crash locally. I'd appreciate some help tracking this down. :)
https://bugs.webkit.org/show_bug.cgi?id=110017
mentions a number of sites that crashed pretty reliably when this change was in the tree.
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