fix: add --no-same-owner --no-same-permissions to tar extraction (PILOT-272)#191
fix: add --no-same-owner --no-same-permissions to tar extraction (PILOT-272)#191matthew-pilot wants to merge 1 commit into
Conversation
…OT-272) GNU tar preserves file ownership and permissions from the archive by default, including setuid/setgid bits. A compromised release with matching checksums could deliver setuid binaries via the tarball. Detect GNU tar at extraction time and pass --no-same-owner and --no-same-permissions. BSD/macOS tar already defaults to safe behavior (ignores ownership without root), so flags are only set on GNU tar. Fixes: PILOT-272
|
🤖 Hank — CI status Classification: The build/test failure is a genuine code defect:
@matthew-pilot — fix or comment. Auto-classified at 2026-06-01T21:40:00Z. Re-runs on next push or check completion. |
🦾 Matthew PR Status — #191Title: fix: add --no-same-owner --no-same-permissions to tar extraction (PILOT-272) TicketsLabels
Files Changed
Next Actions
🦾 Auto-generated status check by matthew-pr-worker |
🦾 Matthew PR Explain — #191What this PR doesfix: add --no-same-owner --no-same-permissions to tar extraction (PILOT-272) Scope
TicketsFiles
Review Notes
🦾 Auto-generated explain by matthew-pr-worker |
📊 PR Status — PILOT-272PR State: OPEN · Not draft · Canary: ❌ failed — Jira PILOT-272: TO DO · Unassigned · Labels:
Last operator activity: Jira updated 2026-05-31 14:42 EEST, PR updated 2026-05-31 18:30 UTC ⚡ matthew-fix: added --no-same-owner + --no-same-permissions flags to tar extraction. Canary failed — needs operator review. |
What
Add
--no-same-owner --no-same-permissionsflags totar -xzfand the fallbackgunzip | tar -xextraction ininstall.sh.Why
GNU tar preserves file ownership and permissions from the archive by default, including setuid/setgid bits. A compromised GitHub release with matching SHA-256 checksums could deliver setuid binaries via the tarball (defense-in-depth — the checksums attestation gate must also be bypassed, but layered defenses are appropriate for an installer).
BSD/macOS tar already defaults to safe behavior (ignores ownership without root), so the flags are only set when GNU tar is detected at runtime.
Changes
install.sh: +9/-2 linestar --version | grep 'GNU tar'TAR_SAFE="--no-same-owner --no-same-permissions"when GNU tar detected$TAR_SAFEto both tar invocations (primary and fallback)Verification
sh -n install.sh)tar -xzf ... --no-same-owner --no-same-permissions -C ...)Tier
small — 1 file, +9/-2 LoC
🤖 matthew-pilot | PILOT-272