Skip to content

backlog: amend #1129 -- a literal before-uncompressing check ships default-on, and cites this cell in its own source - #359

Merged
wshallwshall merged 2 commits into
mainfrom
claude/amend-1129-dicom-inflate
Aug 13, 2026
Merged

backlog: amend #1129 -- a literal before-uncompressing check ships default-on, and cites this cell in its own source#359
wshallwshall merged 2 commits into
mainfrom
claude/amend-1129-dicom-inflate

Conversation

@wshallwshall

Copy link
Copy Markdown
Collaborator

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:

_inflate.py   bounded_inflate_or_error(compressed, *, max_bytes) -> None
              inflates in _INFLATE_CHUNK-bounded chunks, DISCARDING the output,
              raises DicomBombError the instant cumulative size would cross the cap
              guard_part10_deflate(data, *, max_bytes=DEFAULT_MAX_INFLATED_BYTES)
              runs BEFORE any dcmread -- the default argument is what makes it default-ON
peek.py:81    "# ASVS 5.2.3: ... Pre-check the inflate in bounded memory and reject
               an over-cap object ... BEFORE dcmread ever touches it."

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_decompress half is unchanged: max_output_bytes=None by 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.

…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
wshallwshall enabled auto-merge (squash) August 13, 2026 00:51
@wshallwshall
wshallwshall merged commit a1344e8 into main Aug 13, 2026
33 of 34 checks passed
@wshallwshall
wshallwshall deleted the claude/amend-1129-dicom-inflate branch August 13, 2026 11:24
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.

1 participant