-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
Generating identitcal JWT token and authenticating results in server go panic #14931
Comments
@Shambuwu hi, could you provide a way to reproduce the issue? I think you attached the special token to a request in an adhoc way? |
Start an ETCD server with a given keypair:
Using this same keypair, generate a JWT token with an identitical payload to the one the server returns when querying the auth/authenticate endpoint with a username/password. Add this JWT token to your request headers. In my case this ends up with the server having a go panic. |
Also, the server actually succeeds in authenticating the user, the panic occurs after.
|
Please decode the token using an online tool, such as https://jwt.io/. Based on the error, there should be no field "revsion". But of course, we should add protection to prevent etcdserver from panicking. So please anyone feel free to deliver a PR on this. |
@Shambuwu I don’t think this is a realistic issue. If you own a key pair (and etcd cluster itself), you can do it but I don’t recommend to generate tokens outside of etcd… Do you have any reasons to do it? Anyway preventing panic is better though. |
Moving backport labels to PR instead of issue. |
What happened?
Authenticating with a JWT token that has been generated with the same payload en keypair as the server results in the server getting a go panic and shutting down.
panic: interface conversion: interface {} is nil, not float64
Authenticating with a JWT token that the server generated does work however, even though the signatures of both tokens get verified with the same public key.
What did you expect to happen?
I expect an identitcal JWT token to properly authenticate the client, this does not happen however and completely shuts down the ETCD server.
How can we reproduce it (as minimally and precisely as possible)?
Generate and identical JWT token to one the server generates with a given keypair. Use this to authenticate a client.
Anything else we need to know?
No response
Etcd version (please run commands below)
Etcd configuration (command line flags or environment variables)
etcd --auth-token=jwt,pub-key=/jwt/public.pem,priv-key=/jwt/private.pem,sign-method=RS256
Etcd debug information (please run commands blow, feel free to obfuscate the IP address or FQDN in the output)
Relevant log output
The text was updated successfully, but these errors were encountered: