Skip to content

fix(security): add decompression bomb protection to untarUnder (PILOT-418)#284

Closed
matthew-pilot wants to merge 2 commits into
mainfrom
openclaw/pilot-418-20260618-083500
Closed

fix(security): add decompression bomb protection to untarUnder (PILOT-418)#284
matthew-pilot wants to merge 2 commits into
mainfrom
openclaw/pilot-418-20260618-083500

Conversation

@matthew-pilot

Copy link
Copy Markdown
Collaborator

What

The untarUnder function in cmd/pilotctl/appstore_catalogue.go extracts tar entries from app store catalogue bundles without a per-file size limit.

Why

While the HTTP download is already capped at 1 MiB (io.LimitReader(body, 1<<20)), a maliciously crafted tar.gz with an extreme compression ratio could bypass this cap and fill disk through decompression.

Fix

Wrap the tar entry extraction with io.LimitReader(tr, 64<<20) — a 64 MiB per-file maximum. This matches the size limit used by similar extraction functions in the codebase.

Verification

  • go build ./cmd/pilotctl/ — passes
  • go vet ./cmd/pilotctl/... — clean
  • Only 1 file changed: cmd/pilotctl/appstore_catalogue.go (+5/-2 lines)

Closes PILOT-418

…-418)

The untarUnder function used io.Copy without a per-file size limit when
extracting tar.gz entries from app store catalogue bundles. While the
HTTP download is capped at 1 MiB, a maliciously crafted archive with an
extreme compression ratio could fill disk.

Fix: wrap tar entry extraction with io.LimitReader(tr, 64<<20) for a
64 MiB per-file maximum.

Closes PILOT-418
@matthew-pilot matthew-pilot added canary-failed Canary harness tests failed for this PR and removed canary-failed Canary harness tests failed for this PR labels Jun 19, 2026
@matthew-pilot

Copy link
Copy Markdown
Collaborator Author

Superseded by #288 — closing.

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