Skip to content

Commit 4b168e5

Browse files
Nick Sullivanclaude
andcommitted
🔒 Fix critical shell injection vulnerability
Actually sanitize task description input, not just warn. Use tr -cd to strip dangerous characters immediately. Addresses critical security issue from bot review. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 1e052e0 commit 4b168e5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

.claude/commands/autotask.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,10 @@ Creating isolated development environment for clean, parallel work:
5353
mkdir -p .gitworktrees
5454

5555
# Generate branch name from task
56-
TASK_NAME="{{TASK_DESCRIPTION}}"
56+
TASK_NAME_RAW="{{TASK_DESCRIPTION}}"
5757

58-
# Validate task description doesn't contain dangerous shell metacharacters
59-
if echo "$TASK_NAME" | grep -q '[;& |`$(){}]'; then
60-
echo "⚠️ Task description contains shell metacharacters - sanitizing..."
61-
fi
58+
# Sanitize task description immediately (security)
59+
TASK_NAME=$(echo "$TASK_NAME_RAW" | tr -cd '[:alnum:][:space:]-_')
6260

6361
BRANCH_NAME=$(echo "$TASK_NAME" | \
6462
tr '[:upper:]' '[:lower:]' | \

0 commit comments

Comments
 (0)