Skip to content

fix: protect against specially crafted archives setting high AES cycles#448

Merged
bodgit merged 3 commits into
bodgit:mainfrom
hobeone:aes_protect
May 21, 2026
Merged

fix: protect against specially crafted archives setting high AES cycles#448
bodgit merged 3 commits into
bodgit:mainfrom
hobeone:aes_protect

Conversation

@hobeone
Copy link
Copy Markdown
Contributor

@hobeone hobeone commented May 17, 2026

add maxCyclesPower to cap the number of cycles.
add tests to validate behavior

Cycles setting comes directly from the archive's AES properties byte
which could be set to something like cycles=62 which would mean 2^62 ≈
4.6×10^18 SHA-256 iterations, which would effectively hang the process.
Standard 7-zip archives use cycles=19 so setting the cap to 24 gives
headroom to the standard while still protecting from a malicious file

@hobeone hobeone changed the title Protect against specially crafted archives setting high AES cycles fix: protect against specially crafted archives setting high AES cycles May 17, 2026
@coveralls
Copy link
Copy Markdown

coveralls commented May 19, 2026

Coverage Status

coverage: 74.889% (+0.2%) from 74.727% — hobeone:aes_protect into bodgit:main

hobeone and others added 2 commits May 22, 2026 00:43
add maxCyclesPower to cap the number of cycles.
add tests to validate behavior

Cycles setting comes directly from the archive's AES properties byte
which could be set to something like cycles=62 which would mean 2^62 ≈
4.6×10^18 SHA-256 iterations, which would effectively hang the process.
Standard 7-zip archives use cycles=19 so setting the cap to 24 gives
headroom to the standard while still protecting from a malicious file
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bodgit bodgit merged commit ec43e2b into bodgit:main May 21, 2026
3 checks passed
@bodgit
Copy link
Copy Markdown
Owner

bodgit commented May 21, 2026

Thanks for the contribution!

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.

3 participants