backlog: amend #1129 -- a literal before-uncompressing check ships default-on, and cites this cell in its own source - #359
Merged
Conversation
…fault-on, and cites this cell in its own source Reported by the ASVS tracking lane; all claims verified here against origin/main. WHAT SHIPS. parsing/dicom/_inflate.py provides bounded_inflate_or_error(compressed, *, max_bytes): inflates in bounded chunks, DISCARDS the output, and raises DicomBombError the instant the cumulative uncompressed size would cross the cap, so a small compressed bomb with a huge inflated size never materialises in memory. guard_part10_deflate(data, *, max_bytes=DEFAULT_MAX_INFLATED_BYTES) runs it BEFORE any dcmread, and the default argument is what makes it default-on rather than opt-in. AND THE CODE NAMES THE CELL. peek.py:81 reads "ASVS 5.2.3: ... Pre-check the inflate in bounded memory and reject an over-cap object ... BEFORE dcmread ever touches it." The module knew about this item while the item did not know about the module -- the same shape already recorded on #1114. WHY THIS IS NOT A SMALL CORRECTION. The item's ground is that the engine enforces ceilings INCREMENTALLY INSTEAD of checking before uncompressing. That is the pinned verb's exact distinction, and it is false for the DICOM path: this IS the literal before-uncompressing check the verb asks for. The zip_decompress half stands. RE-SCOPE: whether zip_decompress's max_output_bytes=None default is an honest gap GIVEN that the transport-facing path already does the literal check, and whether "maximum number of files" is answered anywhere. Narrower and harder than the question filed. PATTERN, recorded in the item rather than left in chat: this is the SECOND item from the 2026-08-08 sweep with a false central premise, after #1131. Both failed the same way -- the absence was asserted from plausible shapes rather than from the state. #1131's regex could not match admin_reset_password; this one looked at the archive reader and never looked for a bounded inflate elsewhere. If a third turns up, the sweep's METHOD is the defect and wants its own item rather than another amendment.
wshallwshall
enabled auto-merge (squash)
August 13, 2026 00:51
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.
Docs-only. #1129 stays OPEN, on a narrower question. No new number.
The central premise is false
The item's ground is that the engine enforces ceilings incrementally instead of checking before uncompressing. That is the pinned verb's exact distinction -- and it is false for the DICOM path.
Verified against
origin/main:So a small compressed bomb with a huge inflated size never materialises in memory, and this is the literal before-uncompressing check the verb asks for.
The module names this very cell in its own source. The code knew about the item while the item did not know about the code -- the same shape already recorded on #1114.
What still stands
The
zip_decompresshalf is unchanged:max_output_bytes=Noneby default, so a Handler author calling it without a ceiling gets none.Re-scope: whether that default is an honest gap given that the transport-facing path already does the literal check, and whether "maximum number of files" is answered anywhere. Narrower and harder than "does a before-uncompressing check exist", which is answered.
The pattern, recorded in the item rather than left in chat
This is the second item from the 2026-08-08 sweep with a false central premise, after #1131. Both failed the same way: the absence was asserted from plausible shapes rather than from the state. #1131's regex could not structurally match
admin_reset_password; this one looked at the archive reader and never looked for a bounded inflate elsewhere.If a third turns up, the sweep's method is the defect and wants its own item rather than another amendment. Writing that trigger down now, so the third instance is recognised as a pattern rather than filed as a third one-off.