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

Security issue checking AUD when its falsey #445

Closed
bundabrg opened this issue Mar 22, 2022 · 1 comment
Closed

Security issue checking AUD when its falsey #445

bundabrg opened this issue Mar 22, 2022 · 1 comment
Assignees
Labels

Comments

@bundabrg
Copy link

Describe the bug

If a passed in 'aud' is an empty list [] then it will not be validated yet will still pass the essential claims validation as the checks are performed in two different ways. This may extend to other claims as well.

To Reproduce

claims_options = {
  "aud": {
    "essential": True,
    "value": "my_aud",
}

# token contains the data {'aud': []}
token = get_raw_token()

tok = jwt.decode(token, my_public_key, claims_options=claim_options)
tok.validate() # Passes

Expected behavior

An exception should be raised in validate_aud(). I'm not sure if one should be raised when checking essential claims since technically the claim is there.

Environment:

  • OS: Linux
  • Python Version: 3.8
  • Authlib Version: 1.0.0
@bundabrg bundabrg added the bug label Mar 22, 2022
lepture added a commit that referenced this issue Apr 6, 2022
@lepture
Copy link
Owner

lepture commented Apr 6, 2022

v1.0.1 was released.

@lepture lepture closed this as completed Apr 6, 2022
coopfeathy added a commit to coopfeathy/authlib-django that referenced this issue Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants