Skip to content

Catch potential error importing key and re-raise - #403

Merged
simo5 merged 1 commit into
latchset:mainfrom
simo5:minorfix
Oct 30, 2026
Merged

simo5 merged 1 commit into
latchset:mainfrom
simo5:minorfix

Conversation

@simo5

@simo5 simo5 commented Oct 30, 2026

Copy link
Copy Markdown
Member

Might raise with some TypeError/ValueError or similar, re-catch and just emit InvalidJWKValue.

Originally reported by @VadimToptunov as a security issue, but it is just a bug.

Any reasonable application always has to use a broad try/except around jwcrypto calls because there is no guarantee anywhere from documentation that only JWXX exceptions are ever returned and in fact jwcrypto raises ValueError and other non-JWXX errors in many places.

Might raise with some TypeError/ValueError or similar, re-catch and just
emit InvalidJWKValue.

Signed-off-by: Simo Sorce <simo@detuned.org>
@simo5
simo5 merged commit 916ae4a into latchset:main Oct 30, 2026
16 checks passed
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