Skip to content

fix(verify): validate audience and issuer options and claim types - #1058

Open
draarivpatel-ui wants to merge 1 commit into
auth0:masterfrom
draarivpatel-ui:fix-verify-claim-checks
Open

draarivpatel-ui wants to merge 1 commit into
auth0:masterfrom
draarivpatel-ui:fix-verify-claim-checks

Conversation

@draarivpatel-ui

Copy link
Copy Markdown

Fixes #1054.

jwt.verify() silently accepted unsupported audience/issuer option types, and a RegExp audience could accept a token with no aud claim because the missing claim was coerced to the string "undefined".

  • Reject non-string/non-array/non-RegExp audience options and non-string/non-array issuer options up front with a JsonWebTokenError.
  • Require every element of the aud claim to be a string before comparing, so RegExp audiences can no longer match a missing or non-string claim.
  • Add regression tests for invalid option types, missing aud, and numeric aud.

Full suite: 517 passing, 1 pending. Lint clean.

@draarivpatel-ui
draarivpatel-ui requested a review from a team as a code owner November 25, 2026 20:38
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.

Independent code audit (Nacodex, October 2026): 11 findings after review at commit b924272

1 participant