oauth2 icon indicating copy to clipboard operation
oauth2 copied to clipboard

Key PEM parsed for every JWT signed token

Open smw1218 opened this issue 5 years ago • 0 comments

In oauth2/generates/jwt_access.go:55-66, when using RSA or ECC, the key is parsed from PEM to sign every token. This should be done once and cached.

This makes signing slow (as this step runs rsa.Precompute on every call). Also, the parse code may not be cryptographically secured against timing attacks and it might be possible to extract the private key via side channel attack.

smw1218 avatar Dec 22 '19 17:12 smw1218