Re: [whatwg] Security thoughts

2010-08-03 Thread Ian Hickson
On Sun, 9 May 2010, Perry Smith wrote:
>
> In HTML5 6.3.1 Relaxing The Same Origin Restriction [1] bullet 3, sub 
> bullet 3 there is a clause that says that if the domain is reduced down 
> to something that is on the Public Suffix List, the new value is 
> rejected.  That phrase caused me to pause.
> 
> I was wondering about internal attacks.  First, we need to assume a 
> couple of things but they are relatively easy to assume.  The first is 
> that the relaxing of the restriction has a valid use.  This seems easy 
> or it would not be in the spec.  The second is that an internal domain 
> can effectively be a public suffix list to users on the internal 
> intranet.  For example, at the place I work, I connect my laptop to the 
> wifi, it grabs an address and also registers the name.  Even if the name 
> was not registered, it would still have some DNS entry.  The point is 
> that all DNS entries within this subdomain are not trusted.
> 
> If we have a site like official_site.area_subdomain.big.com which 
> relaxes the restriction to area_subdomain.big.com, it is now exposed to 
> the potential of an attack from any of the systems within the same 
> area_subdomain including laptops connected via wifi.  The wifi is 
> secure.  The place I work at trusts me to some degree but with a large 
> corporation, they very often try to restrict information on the "need to 
> know" basis.  And, corporate espionage is a real threat.
> 
> I don't know how common it is for internal corporate sites to relax the 
> same origin restriction but I could see it becoming more and more common 
> as they try to take advantage of various technologies.
> 
> The corporations could take steps of course to secure the sites.  They 
> could put all official web sites in their own subdomain and then relax 
> to this more trusted subdomain.
> 
> The purposed of this email is to ask if a warning should be added in the 
> 3rd bullet to advise web developers of internal sites to be careful in 
> assuming that all the hosts on their internal subdomain are trusted.

I would be happy to add such a warning, but I'm not sure I understand the 
attack you had in mind.

Is this the scenario you have in mind?:

   User A controls a laptop within Example Corp's firewall and has a host 
   name of laptop1.corp.example.com.

   User B is also within the firewall.

   Service V is at service.corp.example.com, and it uses document.domain 
   to relax its same-domain restrictions to "example.com".

   User A tricks User B into visiting a file hosted on his laptop.

   That file relaxes its same-domain restriction to "example.com", loads 
   service V in an iframe, and uses the DOM to perform an attack on V 
   using B's credentials.

-- 
Ian Hickson   U+1047E)\._.,--,'``.fL
http://ln.hixie.ch/   U+263A/,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


Re: [whatwg] Security thoughts

2010-05-09 Thread timeless
On Mon, May 10, 2010 at 2:31 AM, Perry Smith  wrote:
> If we have a site like official_site.area_subdomain.big.com which relaxes the
> restriction to area_subdomain.big.com, it is now exposed to the potential of
> an attack from any of the systems within the same area_subdomain including
> laptops connected via wifi.  The wifi is secure.  The place I work at trusts 
> me
> to some degree but with a large corporation, they very often try to restrict
> information on the "need to know" basis.  And, corporate espionage is a real 
> threat.

Sites shouldn't be configured this way.

They should have two domains, one used for corporate servers:
*.big.com
one used for untrustworthy systems:

.evil

There's no reason to stick computers into area_subdomain.big.com (if
you manage to get dns search right).

I've seen networks which are properly configured with a secondary domain.

But roughly speaking, if you're allowed to put a computer into
.area_subdomain.big.com, your neighbors have already lost.

Where I work, we have hundreds of servers which pop up random dialogs
asking for my windows domain credentials. Some use HTTP Auth requests,
some use html forms to ask for it. There's no way for a user to
determine if a server is real or not, and most have expired or
otherwise invalid certificates, everyone has to trust all of them.
Thus we trust the network not to allow computers which don't belong
into the interesting subnets (and in theory there's something
patrolling those networks to guard against this problem).