-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Jjwt accepts signature that is also base64 encoded #192
Comments
I would gladly fix that but I need to know what is your preference |
I don't see this as an issue? I mean, this could be seen as a 'feature, not a bug'. In other words, JJWT will correctly base64url decode signatures as expected. It also might base64 decode signatures too. What is the problem? |
The problem is that it will work for subset of all possible inputs which makes this |
Only Base64Url is allowed now per #333 which has been merged to master and will be released in 0.10.0 |
Released in 0.10.0. |
Somehow by accident jjwt will accept base64 encoded signatures although according to RFC it should be base64url encoded. The problematic part is that you decode base64 so first you convert signature from base64url to base64. But this convertion doesn't check for presence of
+
or/
before conversion (which would meant that we have wrong string). Here is the functionBase64UrlCoded#decode
:and here simplest solution:
Or maybe instead of
javax.xml.bind.DatatypeConverter
use something that has support for Base64Url https://google.github.io/guava/releases/19.0/api/docs/com/google/common/io/BaseEncoding.html?The text was updated successfully, but these errors were encountered: