Skip to content

fix: only treat tar as create when the mode flag is actually c - #13143

Open
tonycoder-hub wants to merge 1 commit into
continuedev:mainfrom
tonycoder-hub:cursor/fix-tar-create-flag-detection-88a8
Open

fix: only treat tar as create when the mode flag is actually c#13143
tonycoder-hub wants to merge 1 commit into
continuedev:mainfrom
tonycoder-hub:cursor/fix-tar-create-flag-detection-88a8

Conversation

@tonycoder-hub

Copy link
Copy Markdown

Safe-create check matched any argument containing the letter c. Mode flags only. 228 tests passed in packages/terminal-security.

…chive creation

`isSafeCommand` scanned every tar argument for a "c", so file operands such as
`archive.tar.gz` made extraction look like archive creation. `tar -xzf
archive.tar.gz` was therefore auto-approved without a permission prompt.

Restrict the create-flag check to tar's mode flags (short bundles with or
without a leading dash, and `--create`).

Co-authored-by: Tony Coder <407243179@qq.com>
@tonycoder-hub
tonycoder-hub requested a review from a team as a code owner August 17, 2026 09:55
@tonycoder-hub
tonycoder-hub requested review from sestinj and removed request for a team August 17, 2026 09:55
@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@tonycoder-hub

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@tonycoder-hub

Copy link
Copy Markdown
Author

recheck

@cursor
cursor Bot force-pushed the cursor/fix-tar-create-flag-detection-88a8 branch from e510f18 to d2bb4ca Compare August 17, 2026 10:44
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.

1 participant