Hardening: bound the decompress-to-temp size before the extraction caps run #6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Follow-up from the review of #5 (which closed #2). The size/entry caps in
assertSafeTarprotect the destination: an over-cap archive is refused beforetar -xfwrites anything todestDir. But for a compressed artifact,extractArchivefirst decompresses the whole object to a temp.tarinos.tmpdir()so the header walk has random access:So a high-ratio decompression bomb (tiny object, huge expansion) is still written in full to
/tmpbefore the byte cap rejects it. It fails closed (a full/tmpaborts the pipeline and nothing reaches the destination), but a single hostile artifact can still exhaust the runner's temp disk, which is a DoS on co-scheduled jobs.Acceptance criteria
gzip -dc/zstd -dcpipe once it exceedsRASTER_ARTIFACTS_MAX_TOTAL_BYTES), or validate headers off the decompression stream without a full temp materialization.0/disabled cap keeps current behavior.Scope note
cache-action does not share this exposure: its restore streams
gzip -dc | tar -tvPfor the listing andgzip -dc | tar -xpPfor extraction, and enforces the size cap from the streamed listing, so it never materializes a decompressed temp tar. This issue is download-artifact-action-specific (it needs random access for the manual header walk).Refs #5, #2.