Skip to content

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

Open
hobeone wants to merge 1 commit into
bodgit:mainfrom
hobeone:aes_protect
Open

fix: protect against specially crafted archives setting high AES cycles#448
hobeone wants to merge 1 commit into
bodgit:mainfrom
hobeone:aes_protect

Conversation

@hobeone
Copy link
Copy Markdown

@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
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
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 74.979% (+0.2%) from 74.815% — hobeone:aes_protect into bodgit:main

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.

2 participants