Skip to content

fix: validate the iss claim on OIDC bearer tokens - #3

Merged
Taure merged 1 commit into
mainfrom
fix/validate-issuer
Jul 1, 2026
Merged

fix: validate the iss claim on OIDC bearer tokens#3
Taure merged 1 commit into
mainfrom
fix/validate-issuer

Conversation

@Taure

@Taure Taure commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

From the asobi SDK-access security review (HIGH). nova_auth_oidc_jwt:validate_claims/3 validated exp and aud but not iss (the docstring claimed it did). A validly-signed token whose key the JWKS resolves could be accepted regardless of issuer.

Adds an iss check between exp and aud: the token's iss must equal the provider's configured issuer{error, invalid_issuer} otherwise.

  • Exposes validate_claims/3 for testing.
  • New 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.
  • Converts two deprecated catch exprs in the CT suite to try so it compiles on OTP 29 (pre-existing).

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
Taure merged commit 74ca94e into main Jul 1, 2026
15 checks passed
@Taure
Taure deleted the fix/validate-issuer branch July 1, 2026 18:20
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).
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

Successfully merging this pull request may close these issues.

1 participant