-
Notifications
You must be signed in to change notification settings - Fork 61
Invalid cookie headers being returned #175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It's not clear what a fix to this could even be. Combining the headers into one only happens on the final step when requesting the Set-Cookie header as a single entity. There is no other way that could be returned without throwing away data or throwing an error. Possibly a documentation note that not all headers can be represented as a single value. |
@haarg the header spec allows this:
So long as each So maybe warn if cookies are fetched in scalar context, or provide a new method which canonically returns multiple |
The step that combines the headers into a single entry is the final |
Looking at
I don't know if there are other field names that should apply to? |
Hi there,
I think this might belong against
HTTP::Headers::Fast
, but it's popping up in a client's Plack stack, so I thought I would start here first. This is a small test case:That final line prints:
Per the IETF spec, we have a couple of violations:
As a consequence of the above, in the last sentence of section 4.1.2, we find the following:
Because the header fields are joined on a comma, we have an invalid
secure,
attribute, which suggests that strict cookie parsers might accept the cookie, but ignore thestrict
attribute. This might be a serious security concern.In the above example, we have the cookie
foo
being set twice, with different values and attributes. This caused a serious authentication issue in our client's code.Admittedly, this code is being used extensively and I'm unsure about a decent approach to solving it.
The text was updated successfully, but these errors were encountered: