Fix for CVE-2024-33664. JWE limited to 250K#352
Merged
asherf merged 9 commits intompdavis:masterfrom Feb 6, 2025
Merged
Conversation
|
Is this repository still maintained? Would be great to check and merge this PR. |
|
Thank you for this work @alistairwatts. Would love to see this PR go in. |
keith-oak
approved these changes
May 14, 2024
Shinnnyshinshin
approved these changes
May 14, 2024
alistairwatts
commented
May 15, 2024
jose/jwe.py
Outdated
| # data could lead to large memory usage. This helps address This addresses | ||
| # CVE-2024-33664. Also see _decompress() | ||
| if len(jwe_str) > JWE_SIZE_LIMIT: | ||
| raise JWEError("JWE string exceeds {JWE_SIZE_LIMIT} bytes") |
Contributor
Author
There was a problem hiding this comment.
This should be an f-string.
This was referenced May 21, 2024
Closed
|
if @mpdavis does not work maybe @michaeldavis-wf will? |
libo
reviewed
May 29, 2024
libo
left a comment
There was a problem hiding this comment.
I fixed the missing f-string. @alistairwatts
Collaborator
|
Can you rebase your changes onto the latest |
bmwiedemann
pushed a commit
to bmwiedemann/openSUSE
that referenced
this pull request
Jun 3, 2024
https://build.opensuse.org/request/show/1178245 by user dgarcia + anag+factory - Update CVE-2024-33664.patch with upstream mpdavis/python-jose#352 bsc#1223422
|
Any updates here? |
|
Right now we should be checking the length of the tokens at the API level whilst waiting for this fix? Dependabot brought me here. |
b2e97ab to
f7e0759
Compare
f7e0759 to
b91c69c
Compare
asherf
reviewed
Feb 5, 2025
asherf
reviewed
Feb 5, 2025
asherf
reviewed
Feb 5, 2025
eed962f to
17db60b
Compare
asherf
reviewed
Feb 6, 2025
asherf
reviewed
Feb 6, 2025
asherf
reviewed
Feb 6, 2025
asherf
reviewed
Feb 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fix for CVE-2024-33664 ensures that any incoming JWE is under 250K, which seems to be a sensible, albeit large limit. The specific fix for the "zip bomb" issue ensures that we decompress no more that 250K of data. If that limit is reached then a JWEError is raised.
There's rough symmetry here ensuring that both compressed and uncompressed JWE data is no more than 250K.