Comments (1)
Hi @laurids! This was a design decision in the early days of JJWT in the spirit of the "robustness principle". The main reason being that illegal Base64 characters in the beginning or the end from people trying to 'trick' signature comparisons doesn't actually change the underlying signature, so there is no reason to fail: if the signature is confirmed successfully (from a cryptographic perspective), people trying to 'play games' doesn't impact the security properties of the underlying signature/mac algorithm (which would otherwise be 'security by obscurity' and therefore useless).
We can keep this issue open to track changing the behavior, but this implementation has been around for 8-9 years now; odds are high that existing usages depend on this behavior, so we'd probably only be able to change this on a major release or next significant point release.
As you mention, at least until we feel we can/should change the code, the easiest workaround is to use a (fairly simple) custom Base64Url decoder per https://github.com/jwtk/jjwt#custom-base64.
Thanks for creating the issue!
from jjwt.
Related Issues (20)
- Option to enable strict duplicate detection HOT 4
- parseSignedClaims(JWE) calls key locator HOT 2
- Add io.jsonwebtoken.SignatureAlgorithm#assertValidSigningKey in new class HOT 1
- Typo in changelog HOT 1
- java.lang.NoSuchMethodError: org.json.JSONTokener.<init>(Ljava/io/Reader;)V HOT 15
- package jjwt is not resolved HOT 4
- Locator for Key has no access to JWT claims (issuer) HOT 1
- Error building JWT with non-string audience claim type HOT 4
- A single audience value gets converted into a set with one entry HOT 1
- Disable Jackson ObjectMapper FAIL_ON_UNKNOWN_PROPERTIES Deserialization Feature HOT 1
- Unable to extract claims when cty specified in JWS header (>0.12.0) HOT 19
- Question: How far is version 1.0 (due to breaking changes in 0.12)?
- NIST Elliptic Curve JWK field element octet string padding HOT 1
- Allow parsing signed JWTs without the key HOT 1
- Impossible to build a JWK with `alg: HS512` and a `k` that is larger than 64 bytes HOT 2
- Make JacksonDeserializer constructor public
- Unable to access jcaName from Jwts.SIG HOT 2
- Jwts.builder - audience cannot be add without calling add() HOT 5
- Consider a convenience method to obtain a `Jwk` from a `JwkSet` by Key ID HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jjwt.