Skip to content
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

/elmr/session does not return secure cookies! #8

Open
ddriddle opened this issue Apr 5, 2019 · 1 comment
Open

/elmr/session does not return secure cookies! #8

ddriddle opened this issue Apr 5, 2019 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ddriddle
Copy link
Contributor

ddriddle commented Apr 5, 2019

Elmr does not set the Secure or HttpOnly flags for the cookie it creates as can be seen here:

$ curl --cookie '__edu.illinois.techservices.elmr.serviceUrl=/foo/bar' -sD - http://127.0.0.1/auth/elmr/session
HTTP/1.1 302 302
Server: nginx/1.14.2
Date: Fri, 05 Apr 2019 19:05:37 GMT
Content-Length: 0
Connection: keep-alive
Set-Cookie: __edu.illinois.techservices.elmr.servlets.sessionKey=MTIzNA==; Path=/
Location: http://127.0.0.1/foo/bar

Secure should be set to prevent the cookie from being sent in the clean:

When a cookie has the Secure attribute, the user agent will include the cookie in an HTTP request only if the request is transmitted over a secure channel (typically HTTP over Transport Layer Security (TLS) [RFC2818]).
https://tools.ietf.org/html/rfc6265#section-4.1.2.5

HttpOnly should be set to prevent Javascript attacks:

The HttpOnly attribute limits the scope of the cookie to HTTP requests. In particular, the attribute instructs the user agent to omit the cookie when providing access to cookies via "non-HTTP" APIs (such as a web browser API that exposes cookies to scripts).
https://tools.ietf.org/html/rfc6265#section-4.1.2.6

@ddriddle ddriddle added the bug Something isn't working label Apr 5, 2019
@argherna
Copy link
Contributor

argherna commented Apr 9, 2019

Are you running with edu.illinois.techservices.elmr.servlets.DisableSecureCookies set to true? If so, that could be the culprit. By default, not setting this will enable secure cookies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants