Bug 161225 - Calling crossOriginWindow.toString() should not be allowed
Summary: Calling crossOriginWindow.toString() should not be allowed
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: WebExposed
Depends on:
Blocks:
 
Reported: 2016-08-25 19:35 PDT by Chris Dumez
Modified: 2016-08-26 13:37 PDT (History)
7 users (show)

See Also:


Attachments
Patch (9.05 KB, patch)
2016-08-25 20:46 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (9.20 KB, patch)
2016-08-26 12:46 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2016-08-25 19:35:03 PDT
Calling crossOriginWindow.toString() should not be allowed:
- https://html.spec.whatwg.org/#crossoriginproperties-(-o-)

In WebKit, we print a security error in the console but return "[object Window]" anyway.

In Firefox and Chrome, it throws an exception.
Comment 1 Chris Dumez 2016-08-25 20:46:12 PDT
Created attachment 287070 [details]
Patch
Comment 2 Andreas Kling 2016-08-26 10:50:34 PDT
Comment on attachment 287070 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=287070&action=review

> Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:-78
> -    // Allow access to toString() cross-domain, but always Object.prototype.toString.

This looks like it was intentional at some point in time. Do we at least know why?
Comment 3 WebKit Commit Bot 2016-08-26 11:01:15 PDT
Comment on attachment 287070 [details]
Patch

Rejecting attachment 287070 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-01', 'apply-attachment', '--no-update', '--non-interactive', 287070, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
ayoutTests/http/tests/security/cross-frame-access-custom-expected.txt.rej
patching file LayoutTests/http/tests/security/cross-frame-access-custom.html
patching file LayoutTests/http/tests/security/cross-frame-access-object-setPrototypeOf-expected.txt
patching file LayoutTests/http/tests/security/cross-frame-access-object-setPrototypeOf.html

Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force', '--reviewer', u'Andreas Kling']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Full output: http://webkit-queues.webkit.org/results/1948060
Comment 4 Chris Dumez 2016-08-26 12:46:52 PDT
Created attachment 287133 [details]
Patch
Comment 5 WebKit Commit Bot 2016-08-26 13:37:08 PDT
Comment on attachment 287133 [details]
Patch

Clearing flags on attachment: 287133

Committed r205037: <http://trac.webkit.org/changeset/205037>
Comment 6 WebKit Commit Bot 2016-08-26 13:37:13 PDT
All reviewed patches have been landed.  Closing bug.