Skip to content

fix(terminal-security): block more destructive filesystem commands#13006

Open
Solaris-star wants to merge 2 commits into
continuedev:mainfrom
Solaris-star:fix/13001-terminal-destructive-blocklist
Open

fix(terminal-security): block more destructive filesystem commands#13006
Solaris-star wants to merge 2 commits into
continuedev:mainfrom
Solaris-star:fix/13001-terminal-destructive-blocklist

Conversation

@Solaris-star

Copy link
Copy Markdown

Description

Headless/auto mode sets Bash to allow, so the terminal-security denylist is the last backstop against destructive commands. Several high-impact patterns were missing.

  • Disable recursive delete against home, root, var, opt, srv paths
  • Disable recursive delete targeting HOME env / tilde home forms even when shell-quote drops unquoted HOME to an empty token (match original command string)
  • Always disable shred, wipefs, truncate size resets, find -delete, and pkexec
  • Unit tests for the new critical paths

Fixes #13001

Testing

  • cd packages/terminal-security && npm test -> 236 passed

Headless/auto mode relies on the terminal-security denylist as the last
backstop. Expand critical detection so rm -rf against /home, /root, /var,
/opt, /srv and $HOME/${HOME} is disabled, and always-disable shred,
wipefs, truncate -s, find -delete, and pkexec.

shell-quote drops unquoted $HOME to an empty token, so also match home
targets on the original command string. Update unit coverage.

Fixes continuedev#13001
@Solaris-star
Solaris-star requested a review from a team as a code owner July 21, 2026 08:01
@Solaris-star
Solaris-star requested review from sestinj and removed request for a team July 21, 2026 08:01
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 21, 2026
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

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

@Solaris-star

Copy link
Copy Markdown
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incomplete destructive-command blocklist allows auto-execution of filesystem-destroying commands in headless/auto mode

1 participant