Commit a1344e8
authored
backlog: amend #1129 -- a literal before-uncompressing check ships default-on, and cites this cell in its own source (#359)
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.1 parent 97400cc commit a1344e8
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6289 | 6289 | | |
6290 | 6290 | | |
6291 | 6291 | | |
| 6292 | + | |
| 6293 | + | |
| 6294 | + | |
| 6295 | + | |
| 6296 | + | |
| 6297 | + | |
| 6298 | + | |
| 6299 | + | |
| 6300 | + | |
| 6301 | + | |
| 6302 | + | |
| 6303 | + | |
6292 | 6304 | | |
6293 | 6305 | | |
6294 | 6306 | | |
| |||
0 commit comments