News for hackers. Stuff that matters.
Re:Security advisory: Breach and Django by antihero on Tuesday August 06, 2013 @11:37AM (#6167162)
Ok, plausible attack I thought up based on what I could suck up from homakov's and various other posts:

1. User is browsing an HTTPS Django site and a HTTP site on WiFi.

2. Hacker is MITMing a connection (on WiFi), cannot decrypt SSL.

3. Changes user's CSRF token for Django via cookie-forcing.

4. Hacker can now use user's other HTTP session, and inject JS (or whatever) so their browser sends stuff to the HTTPS Django site, fully knowing their CSRF token (because we set it) and thus can forge requests easily.

Does Django mitigate something like that already? I think should be pretty easy to mitigate by using Django's signing to sign the session ID or something into the CSRF token?

Re:Security advisory: Breach and Django by donaldstufft on Tuesday August 06, 2013 @11:42AM (#6167204)
An unrelated HTTP session cannot set a cookie for another domain (unless it's a subdomain in which you have the more serious issue of session theft or session fixation). The solution to both of these problems is HSTS with the includeSubDomains option.
Re:Security advisory: Breach and Django by homakov on Tuesday August 06, 2013 @11:46AM (#6167234)
1) simulate request to http(NOT SECURE)://site.com 2) simulate response with Set-Cookie: csrf_token=123123;

> unless it's a subdomain in which you have the more serious issue of session theft or session fixation

elaborate plz? From what I know, subdomain can only do same attack (cookie tossing). Are you talking about phishing?

Re:Security advisory: Breach and Django by antihero on Tuesday August 06, 2013 @11:45AM (#6167225)
Except we can set the cookie because we're already doing that to HTTPS requests via cookie-forcing.
Re:Security advisory: Breach and Django by donaldstufft on Tuesday August 06, 2013 @12:08PM (#6167374)
I've just woken up and I haven't tested it, but off the cuff I believe HSTS will prevent the browser from trusting a plaintext HTTP response at all. So you cannot force a cookie if I understand the blog post correctly. You'd have to create a cookie inside of a verifiable HTTPS connection, which if you can do you've already executed a much worse attack.
Re:Security advisory: Breach and Django by antihero on Tuesday August 06, 2013 @12:31PM (#6167541)
I think this is what it hinges on:

http://scarybeastsecurity.blogspot.com.es/2008/11/cookie-for...

Is that possible under HSTS?

Re:Security advisory: Breach and Django by homakov on Tuesday August 06, 2013 @12:16PM (#6167430)
> but off the cuff I believe HSTS will prevent the browser from trusting a plaintext HTTP response at all

Cookies are broken (i write about it on my blog like, daily). The essential idea of Forcing is injecting cookies into HTTPS space from HTTP.

Re:Security advisory: Breach and Django by donaldstufft on Tuesday August 06, 2013 @12:23PM (#6167487)
@homakov, so you can get a browser to trust a cookie from a HTTP response under a domain protected by HSTS?
Re:Security advisory: Breach and Django by antihero on Wednesday August 07, 2013 @03:03AM (#6171284)
Doesn't HSTS just mean that the browser will just always make HTTPS responses?