Skip to content

fix: verify common jwt claims for kb-jwt#378

Open
TimoGlastra wants to merge 2 commits into
openwallet-foundation:mainfrom
TimoGlastra:fix/kb-jwt-iat-exp
Open

fix: verify common jwt claims for kb-jwt#378
TimoGlastra wants to merge 2 commits into
openwallet-foundation:mainfrom
TimoGlastra:fix/kb-jwt-iat-exp

Conversation

@TimoGlastra

Copy link
Copy Markdown
Contributor

Fixes #377

Signed-off-by: Timo Glastra <timo@animo.id>
@TimoGlastra TimoGlastra requested a review from a team as a code owner June 23, 2026 10:05
Signed-off-by: Timo Glastra <timo@animo.id>
throw new SDJWTException('Verify Error: Invalid Nonce');
}

// Delegate signature verification and common JWT claim validation

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the spec mandates that some values are required, don't we want to check that instead of the letting the user check it? Or would that complicate the PR a lot?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are not required, but if present we want to check them.

The OID4VP HAIP conformance test suite checks that we reject KB-JWTs where the iat is in the future (and past, but that's maybe harder to solve in this library, what is "past"? it makes sense to reject an iat of one year ago, but there's no strict timeline).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iat is required, and that is check. But it's not checked against the current time. so it can be any value as long as it's defined. This verifies that the iat is not in the future (and will add a check to credo to make it reasonably in the current time (e.g. created X minutes ago). But that feels too opiniated for this library

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.

KB JWT is not verified against standard JWT requirements

3 participants