Skip to content

Conversation

@bshaffer
Copy link
Collaborator

@bshaffer bshaffer commented Dec 3, 2025

fixes #605

Slightly different implementation for #609

@bshaffer bshaffer merged commit 6b80341 into main Dec 15, 2025
8 checks passed
@bshaffer bshaffer deleted the key-size-validation branch December 15, 2025 18:45
@ejunker
Copy link

ejunker commented Dec 16, 2025

thank you @bshaffer for getting this fix in. Does someone need to contact Mitre and get the CVE updated to show that there is a fixed version?

@ro0NL
Copy link

ro0NL commented Jan 7, 2026

@bshaffer should there be a way to opt-out? IIUC currently we need to request new secrets from trusted external partners on our side now :/

@bshaffer
Copy link
Collaborator Author

bshaffer commented Jan 7, 2026

It's protected in a major version of the library so the way to opt out is to not upgrade to the major version until the keys are of sufficient length.

I do recommend contacting your partners if their keys do not reach the minimum length security requirements, however

@ro0NL
Copy link

ro0NL commented Jan 7, 2026

fair; i was wondering how bad a short key really is in case of internal api calls, to a trusted partner. Unpractical at least :')

@bshaffer
Copy link
Collaborator Author

bshaffer commented Jan 7, 2026

@ro0NL I don't know, I just wanted the big red flags that said my library was insecure to go away

@ro0NL
Copy link

ro0NL commented Jan 8, 2026

our partner cannot generate new tokens, so we're stuck at v6, which is an issue.

@ro0NL
Copy link

ro0NL commented Jan 8, 2026

@bshaffer would you consider something like passing new InsecureKey($secret) for a key?

@bshaffer
Copy link
Collaborator Author

bshaffer commented Jan 8, 2026

@ro0NL feel free to submit a PR and I'm happy to review it!

I wouldn't expect you to have any problems staying on v6 for the near future. It also seems strange to me that a partner would not be able to generate new tokens. You could consider padding your existing tokens to reach the minimum key length.

@ro0NL
Copy link

ro0NL commented Jan 8, 2026

@bshaffer thanks for the hint about padding, this seems a reasonable workaround 👍

$secret = str_pad($secret, 32, "\0"); works as-is with v7 👼

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.

⚠️ php-jwt < v6.11.0 was discovered to contain weak encryption.

4 participants