Skip to content

Fix for CVE-2024-33664. JWE limited to 250K - #352

Merged
asherf merged 9 commits into
mpdavis:masterfrom
alistairwatts:cve-2024-33664
Feb 6, 2025
Merged

Fix for CVE-2024-33664. JWE limited to 250K#352
asherf merged 9 commits into
mpdavis:masterfrom
alistairwatts:cve-2024-33664

Conversation

@alistairwatts

Copy link
Copy Markdown
Contributor

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.

@omufeed

Copy link
Copy Markdown

Is this repository still maintained? Would be great to check and merge this PR.

@Shinnnyshinshin

Copy link
Copy Markdown

Thank you for this work @alistairwatts. Would love to see this PR go in.

@CharlesPerrotMinot

Copy link
Copy Markdown

Let's try pinging @asherf and @mpdavis

Comment threadjose/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")

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

This should be an f-string.

@smittysmee

Copy link
Copy Markdown

@mpdavis

@maciejstromich

Copy link
Copy Markdown

if @mpdavis does not work maybe @michaeldavis-wf will?

@libolibo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I fixed the missing f-string. @alistairwatts

Comment threadjose/jwe.py Outdated
@twwildey

Copy link
Copy Markdown
Collaborator

Can you rebase your changes onto the latest master branch and force-update your branch for this PR?

@nicholas-quirk-mass-gov

Copy link
Copy Markdown

@alistairwatts

bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Jun 3, 2024
@CharlesPerrotMinot

Copy link
Copy Markdown

@twwildey

@phasath

Copy link
Copy Markdown

Any updates here?

@BEEFF

Copy link
Copy Markdown

Right now we should be checking the length of the tokens at the API level whilst waiting for this fix? Dependabot brought me here.

Comment threadjose/jwe.py Outdated
Comment threadtests/test_jwe.py Outdated
Comment threadtests/test_jwe.py Outdated
Comment thread.github/workflows/ci.yml Outdated
Comment thread.github/workflows/ci.yml Outdated
Comment threadjose/jwe.py Outdated
Comment threadtests/test_jwe.py Outdated
Sign up for freeto 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.

13 participants

@alistairwatts@omufeed@Shinnnyshinshin@CharlesPerrotMinot@smittysmee@maciejstromich@twwildey@nicholas-quirk-mass-gov@phasath@BEEFF@libo@asherf@keith-oak