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

the auth_openid_cookie should be ssl protected #24

Open
cviecco opened this issue Dec 20, 2011 · 1 comment
Open

the auth_openid_cookie should be ssl protected #24

cviecco opened this issue Dec 20, 2011 · 1 comment
Assignees
Milestone

Comments

@cviecco
Copy link

cviecco commented Dec 20, 2011

the authentication cookie set for openid is not set for ssl_only nor there is a mechanism to set it up. Since this cookie is expected to grant privileges to the end user its default behavior should be to be ssl protected by default.

In lieu with being an authorization cookie, it should also be HttpOnly and not available to javascript (to prevent a class of XSS attacks).

Here is the diff of the one liner to do this:

diff -crB mod_auth_openid-0.6/http_helpers.cpp mod_auth_openid-0.6-new/http_helpers.cpp
*** mod_auth_openid-0.6/http_helpers.cpp 2010-11-27 18:41:45.000000000 +0000
--- mod_auth_openid-0.6-new/http_helpers.cpp 2011-12-19 21:25:39.000000000 +0000


*** 263,268 ****
--- 263,269 ----
strftime(expires, sizeof(expires), "%a, %d-%b-%Y %H:%M:%S GMT", tmp);
cookie_value = name + "=" + session_id + "; expires=" + string(expires) + "; path=" + path;
}

  • cookie_value.append("; secure; HttpOnly");
    

    };

    // Get the post query string from a HTTP POST

@bmuller
Copy link
Owner

bmuller commented Nov 6, 2013

This only makes sense if the server is running HTTPS, which not all servers do, and I'd like to make the module available and useful whether or not someone is using SSL (even though, obviously, they should).

I think this should just be another config option where you can force a secure cookie.

@ghost ghost assigned bmuller Nov 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants