Repository navigation
Conversation
| * holds a secure cookie with the same name whose domain domain-matches the new cookie's | ||
| * domain (or vice versa) and whose path is path-matched by the new cookie's path. | ||
| */ | ||
| private static boolean overlaysSecureCookie(final Cookie cookie, final CookieStore cookieStore) { |
There was a problem hiding this comment.
@Hsnmohd We usually do not implement RFC requirements piecemeal, especially if they are still in draft. Does RFC 6265 have this requirement?
There was a problem hiding this comment.
No. RFC 6265 lets an insecure origin both set a Secure cookie and replace one (5.3 step 11 matches on name, domain and path only), and it calls that out as a known limitation in 4.1.2.5 and 8.6 (Weak Integrity). Both checks here only exist in 6265bis. #869 already has the same two checks as part of the broader 6265bis work, so this one overlaps it; fine to close it in favor of that.
There was a problem hiding this comment.
No. RFC 6265 lets an insecure origin both set a Secure cookie and replace one (5.3 step 11 matches on name, domain and path only), and it calls that out as a known limitation in 4.1.2.5 and 8.6 (Weak Integrity). Both checks here only exist in 6265bis. #869 already has the same two checks as part of the broader 6265bis work, so this one overlaps it; fine to close it in favor of that.
an http:// response can plant or replace secure cookies: BasicSecureHandler enforces Secure only in match, never in validate, and ResponseProcessCookies adds the cookie even when it overwrites a Secure one with the same name, domain and path. a network attacker answering one cleartext request to a host the client also uses over https gets session fixation on the secure origin; reproduced with HttpClients against a local http server, after https://localhost set SESSION=victim; Secure, one http response with Set-Cookie: SESSION=attacker made the next https request send Cookie: SESSION=attacker. reject Secure cookies from an insecure origin in BasicSecureHandler.validate and drop an insecure cookie that would overlay a secure one in ResponseProcessCookies, per RFC 6265bis 5.7 (the "leave secure cookies alone" rule browsers enforce). regression tests in TestBasicCookieAttribHandlers and TestResponseProcessCookies.