Skip to content
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

Audience parsing doesn't reject unexpected items #6

Open
joonas-fi opened this issue Mar 3, 2021 · 1 comment
Open

Audience parsing doesn't reject unexpected items #6

joonas-fi opened this issue Mar 3, 2021 · 1 comment

Comments

@joonas-fi
Copy link

Because there's no default: branch erroring out, I could smuggle any valid JSON there, like true, false, null, any number or an object.

jwt/claims.go

Line 69 in 1639fcf

switch data[0] {

They'll simply be discarded.

I don't know if there's security implications, might not because because header and payload are signed by the issuer, and any tampering would get detected. But since I can't for 100 % say it's a non-issue, I'd feel more comfortable rejecting the data that would get discarded otherwise.

WDYT?

@kataras
Copy link
Owner

kataras commented Apr 9, 2022

Hello @joonas-fi,

This library doesn't perform any "aud" check, as it's already described on the jwt.io website. But I would love to do it so if that is critical for you. Keep in mind that you can perform your own checks against these claims, see TokenValidator.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants