Skip to content

fix(token): add reserved claim blocklist for custom scripts [C3]#545

Merged
lakhansamani merged 1 commit intomainfrom
fix/c3-jwt-claim-blocklist
Apr 4, 2026
Merged

fix(token): add reserved claim blocklist for custom scripts [C3]#545
lakhansamani merged 1 commit intomainfrom
fix/c3-jwt-claim-blocklist

Conversation

@lakhansamani
Copy link
Copy Markdown
Contributor

Summary

  • C3 (Critical): Custom JS token scripts could override any JWT claim including sub, exp, iss, aud, roles, token_type
  • Adds a blocklist of 13 reserved claims that cannot be overridden by custom scripts
  • Applied to both access token and ID token creation paths

Test plan

  • Package compiles
  • Verify custom access token scripts still work for non-reserved claims
  • Verify reserved claims cannot be overridden

Custom access token scripts could override security-critical JWT claims
like sub, exp, iss, aud, roles, and token_type. This adds a blocklist
of reserved claims that are silently skipped when applying custom script
output to both access tokens and ID tokens.

Fixes: C3 (Critical)
@lakhansamani lakhansamani merged commit 011e3a1 into main Apr 4, 2026
@lakhansamani lakhansamani deleted the fix/c3-jwt-claim-blocklist branch April 4, 2026 05:37
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