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

Authentication bypass #3

Closed
georgebashi opened this issue Oct 24, 2014 · 2 comments
Closed

Authentication bypass #3

georgebashi opened this issue Oct 24, 2014 · 2 comments

Comments

@georgebashi
Copy link

Hi, I've just been reading this as I want to implement a similar thing but using Github's OAuth instead.

I've noticed from your implementation that your "logged in" check is simply:

if not ngx.var.cookie_AccessToken then
    ...
end

which is trivially bypassed by just creating a cookie named AccessToken. Am I missing something? Do you authenticate that token separately somewhere else?

FWIW in my implementation I'm planning to use ngx.hmac_sha1 to sign a known message and placing that in the cookie value, which I then check is correct when validating the cookie.

I'd be interested to know if you have a different validation scheme or if I've just missed something obvious in the code. Thanks!

@awestendorf
Copy link
Member

Great catch, thank you! We've only put this to limited use due to time constraints, but that's a pretty obvious security hole I should patch.

@awestendorf
Copy link
Member

A fix for this was pushed out in #4

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