You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I can see it's being caused by the hsts functionality changing the request url to https but not sending the updated url to the cookies_for_url function, so secure cookies are not being sent.
Sure! Is this a spec issue (i.e. where we don't implement the spec correctly)?
Let me know if you need help. I understand what HSTS is, but I don't know the internals of that or secure cookies (could read up if necessary), so I can't help you there, though.
I don't think it's a spec issue, I think it's just an issue with the value that is passed to the cookie code. Each part individually seems to be correct, HSTS and the cookie store, just the values being sent from the http_loader to the cookie store are wrong.
The cookie code then correctly doesn't attach the secure cookie values as it thinks the request is going out to a plain http url.
I'll dig into a little deeper this week, and also check how the hostname changes should effect the cookies sent .
I need to detour a bit first, in order to learn how to write rust code!
Activity
frewsxcv commentedon Oct 21, 2015
GIF of this in action:
Manishearth commentedon Nov 30, 2015
happening on HTTPS too
Manishearth commentedon Nov 30, 2015
I think the same error is happening for Facebook and Wikipedia. I guess our cookies broke?
jdm commentedon Dec 4, 2015
The HTTPS thing was fixed by #8752.
bobthekingofegypt commentedon Feb 21, 2016
Can I have a go at fixing this?
As far as I can see it's being caused by the hsts functionality changing the request url to https but not sending the updated url to the cookies_for_url function, so secure cookies are not being sent.
Manishearth commentedon Feb 21, 2016
Sure! Is this a spec issue (i.e. where we don't implement the spec correctly)?
Let me know if you need help. I understand what HSTS is, but I don't know the internals of that or secure cookies (could read up if necessary), so I can't help you there, though.
jdm commentedon Feb 21, 2016
@bobthekingofegypt: good catch!
bobthekingofegypt commentedon Feb 21, 2016
I don't think it's a spec issue, I think it's just an issue with the value that is passed to the cookie code. Each part individually seems to be correct, HSTS and the cookie store, just the values being sent from the http_loader to the cookie store are wrong.
The code is correctly identifying that github should be on https (because it is in the HSTS list) and it is changing the url over, and makes the final call to the https url.
https://github.com/servo/servo/blob/master/components/net/http_loader.rs#L695
But when it attaches the cookies to be sent with the request, the originating url (the one before any hostname or HTST changes) is passed to the cookie code, not the updated one.
https://github.com/servo/servo/blob/master/components/net/http_loader.rs#L728
https://github.com/servo/servo/blob/master/components/net/http_loader.rs#L532
The cookie code then correctly doesn't attach the secure cookie values as it thinks the request is going out to a plain http url.
I'll dig into a little deeper this week, and also check how the hostname changes should effect the cookies sent .
I need to detour a bit first, in order to learn how to write rust code!
correctly send secure cookies after hsts url match
Auto merge of #9780 - bobthekingofegypt:github_hsts_bug, r=jdm
Auto merge of #9780 - bobthekingofegypt:github_hsts_bug, r=jdm