Skip to content

Comments

Add a command blacklist to queue-processor.js to prevent Claude from executing dangerous commands#5

Open
ubuntupunk wants to merge 4 commits intoTinyAGI:mainfrom
ubuntupunk:main
Open

Add a command blacklist to queue-processor.js to prevent Claude from executing dangerous commands#5
ubuntupunk wants to merge 4 commits intoTinyAGI:mainfrom
ubuntupunk:main

Conversation

@ubuntupunk
Copy link

Summary

Adds a command blacklist to queue-processor.js to prevent Claude from executing dangerous commands like rm -rf, sudo, mkfs, etc.

Changes

  • queue-processor.js: Added BLACKLIST array with 17 dangerous command patterns and isBlacklisted() function to filter them
  • README.md: Documented the blacklist, added security section with future enhancement recommendations (rbash, bubblewrap, command wrapper)

Blocked Commands

Category Commands
File destruction rm -rf, rm -r, rm /
Privilege escalation sudo
Disk operations dd if=, mkfs
Output redirection >:, > /
Permission changes chmod -R 000, chown -R
Process killing kill -9, pkill, killall
Firewall manipulation iptables, ufw disable
Service management systemctl stop
System changes reboot, shutdown

Motivation

Since queue-processor.js runs with --dangerously-skip-permissions, Claude can execute any command the user account can. The blacklist provides an additional layer of protection against accidental or malicious destructive commands.

Testing

  • Blocked attempts are logged to .tinyclaw/logs/queue.log
  • Users receive: "⚠️ This request has been blocked for security reasons."

malloryatefa added a commit to malloryatefa/tinyclaw that referenced this pull request Feb 16, 2026
Fix TinyAGI#1 (High): Port config now respects settings.json. Only MSTEAMS_PORT
env var overrides config; the generic PORT env var and default 3978 no
longer shadow channels.teams.port from settings.

Fix TinyAGI#2 (High): Proactive messaging works via senderId fallback. Stores
conversation references by senderId on every incoming message. Outgoing
queue falls back to senderReferences when pendingMessages has no match,
matching the pattern used by Telegram/Discord/WhatsApp clients.

Fix TinyAGI#3 (High): Real file download/upload support. Incoming attachments
are downloaded to ~/.tinyclaw/files/ with [file: /path] references in
queue messages. Outgoing files are sent as base64-encoded attachments
via the Bot Framework activity API.

Fix TinyAGI#4 (Medium): /reset command implemented. Handles both bare /reset
(shows usage) and /reset @agent_id (writes reset_flag), matching the
exact pattern from telegram-client.ts.

Fix TinyAGI#5 (Medium): Empty message guard added. responseText.trim() is
checked before calling splitMessage/sendActivity in the outgoing queue,
preventing empty activity sends for file-only responses.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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