Skip to content

fix(command-injection): read tar options by implementation (#221) - #230

Merged
SizzleUnrlsd merged 1 commit into
mainfrom
fix/tar-implementations
Oct 7, 2026
Merged

SizzleUnrlsd merged 1 commit into
mainfrom
fix/tar-implementations

Conversation

@SizzleUnrlsd

Copy link
Copy Markdown
Contributor

Summary

GNU tar runs the command that -I, --to-command and --checkpoint-action name; bsdtar (libarchive) reads -I as a file of include patterns and rejects the others.

  • gtar: those options run a command, high.
  • bsdtar: -I is the value of an option that runs nothing, medium; the GNU options are not its own and are read as any option the model does not describe.
  • bare tar: running is possible but depends on the implementation, high hotspot (examine).
  • --use-compress-program runs the compressor on all three, high. gtar and bsdtar honour --.

Verification

New tests in tests/test_tar_implementations.py (red before the fix). One existing expectation changed with prior approval: tests/test_command_arguments.py:108, tar -I{x} HIGH → HIGH_TO_REVIEW. Full suite green apart from the local test_packaging environment issue; ruff, mypy clean; regression snapshots and the mitmproxy scan (75 findings) unchanged.

Closes #221

@SizzleUnrlsd SizzleUnrlsd added the bug Something isn't working label Oct 7, 2026
@SizzleUnrlsd SizzleUnrlsd self-assigned this Oct 7, 2026
@SizzleUnrlsd
SizzleUnrlsd merged commit f25aac2 into main Oct 7, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

command-injection: GNU tar and bsdtar read -I and --to-command differently

1 participant