fix: validate the iss claim on OIDC bearer tokens - #3
Merged
Conversation
validate_claims/3 checked exp and aud but not iss, so a validly-signed token from any issuer the JWKS resolves could be accepted. Enforce that the token's `iss` equals the provider's configured `issuer` (between the exp and aud checks). Exports validate_claims/3 for testing and adds a jwt claim-validation test (exp/iss/aud incl. audience-list). Also converts two deprecated `catch` expressions in the CT suite to `try` so the suite compiles on OTP 29.
Taure
added a commit
that referenced
this pull request
Jul 1, 2026
- .tool-versions -> OTP 29.0.2 / rebar 3.27.0 so CI validates on 29 (the deprecated `catch` in the CT suite was already fixed in #3). - Pin nova to ~> 0.14 (was unversioned).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From the asobi SDK-access security review (HIGH).
nova_auth_oidc_jwt:validate_claims/3validatedexpandaudbut notiss(the docstring claimed it did). A validly-signed token whose key the JWKS resolves could be accepted regardless of issuer.Adds an
isscheck betweenexpandaud: the token'sissmust equal the provider's configuredissuer→{error, invalid_issuer}otherwise.validate_claims/3for testing.nova_auth_oidc_jwt_tests: valid / expired / missing-exp / wrong-iss / missing-iss / wrong-aud / audience-list. eunit 7/0, CT 9/9, fmt clean.catchexprs in the CT suite totryso it compiles on OTP 29 (pre-existing).