Bug 16192 - Support TLD check when changing document.domain
Summary: Support TLD check when changing document.domain
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
: 21318 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-11-29 11:00 PST by Feng Qian
Modified: 2019-12-05 01:31 PST (History)
10 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Feng Qian 2007-11-29 11:00:25 PST
When assigning a new domain name to document.domain, it needs to check the new domain name is more than a top level domain. e.g., 'com', 'co.uk' are not allowed. This is just a short description. I need to do more research on what exactly to support.
Comment 1 Eric Seidel (no email) 2008-04-16 09:29:14 PDT
I'm unclear what that would do?  Besides make it so that your page suddenly couldn't access any domain-based secured information?
Comment 2 Adam Barth 2008-04-16 17:47:59 PDT
Setting your document.domain to "com" or "" will let almost every web site access your DOM, cookies, etc, by setting their document.domain to the same value.  Internet Explorer and Firefox prevent web sites from setting their document.domain shorter than an effective TLD + 1 or a "registry controlled" domain.  For example, stanford.facebook.com can set its document.domain to "facebook.com" but not to "com".  Also, www.hbc.co.uk can set its document.domain to "hbc.co.uk" but not to "co.uk" or to "uk".

This restriction is more to prevent web sites from shooting themselves in the foot than to prevent any particular attack.
Comment 3 Adam Barth 2009-05-19 22:15:21 PDT
*** Bug 21318 has been marked as a duplicate of this bug. ***
Comment 4 Adam Barth 2009-05-19 22:15:53 PDT
Bug 21318 has some useful information about this bug.
Comment 5 Pam Greene (IRC:pamg) 2009-10-19 15:11:26 PDT
I'll take a look at bringing a registry-controlled-domain service into WebKit. It does introduce a slight maintenance burden to keep the data file updated, but as long as it's only being used for document.domain restrictions the risk of stale data is only that it won't be as restrictive as it could be; it'll still be safer than now.
Comment 6 David Kilzer (:ddkilzer) 2014-12-07 17:53:55 PST
<rdar://problem/6266140>