Support base64 padding in json web tokens
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- authentication, security
Research direction
Start with lib/verify-stream.js at the regex line linked in the issue, then review the assumptions referenced in issue #49 and the upstream jsonwebtoken issue. Compare verification behavior for AWS Cognito tokens with padding and assess the security and compatibility implications of universal support versus a flag. Done means the supported behavior and its verification coverage are decided and documented.
Written by the indexing model from the issue text.
Description
This library appears to have taken a hard-line stance that = characters should not be allowed in the JWT encoding, per issue #49 and upstream at auth0/node-jsonwebtoken#607 - and it seems this is in keeping with the JWT spec.
However, I'm working with a feature in AWS whereby you can have a load balancer authenticate users using Cognito and then pass JWTs in special headers to your service. I am trying to verify those JWTs. The tokens include = characters (this is even documented here - "The JWT format includes a header, payload, and signature that are base64 URL encoded and includes padding characters at the end"). Although I realize these tokens are invalid, I'm not in a position to change their format.
One would think a workaround would be to just strip these padding characters from the token, but if the token payload includes padding characters then removing these invalidates the signature.
Fundamentally, I think that in order to verify these tokens while still using the jsonwebtoken library, then this library would need to be changed. I think specifically this line in verify-stream.js.
Would the maintainers of this library consider supporting padding characters in this regex? I'm not sure whether there would be negative security implications of universally supporting padding characters. If there are, perhaps this could be enabled behind a flag.
Thanks!
- Dominant language
- JavaScript
- Stars
- 721
- Forks
- 141
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from auth0/node-jws
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Remove unnecessary safe-buffer dependency (use Node.js built-in Buffer API)May be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
OWASP/CheatSheetSeries#3018 ·
Maintainers usually reply within 1 day
-
Radix number block generates NaN after switching a negative or decimal number to binary, octal or hexPossibly taken @matthewalberto claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
mit-cml/appinventor-sources#4246 · 1 comment ·
Maintainers usually reply within 1 day
-
marketing
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 83/100
GoogleChrome/modern-web-guidance-src#3675 · 2 comments ·
Maintainers usually reply within 1 day