Skip to content

Commit 7d4f19b

Browse files
owineclaude
andcommitted
Fix bash regex syntax errors in input validation
- Properly escape special characters in regex patterns - Fix syntax error with ;& characters in conditional expressions - Escape > and < characters in suspicious commands pattern 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent aa20f9f commit 7d4f19b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ jobs:
8787
COMPOSE_ARGS="${{ inputs.args }}"
8888
if [[ -n "$COMPOSE_ARGS" ]]; then
8989
# Check for dangerous characters and patterns
90-
if [[ "$COMPOSE_ARGS" =~ [;&|`$\\] ]]; then
90+
if [[ "$COMPOSE_ARGS" =~ [\;\&\|\`\$\\] ]]; then
9191
echo "::error::Compose args contain potentially dangerous characters: $COMPOSE_ARGS"
9292
echo "::error::Prohibited characters: ; & | \` $ \\"
9393
exit 1
9494
fi
9595
# Check for suspicious patterns
96-
if [[ "$COMPOSE_ARGS" =~ (rm|kill|shutdown|reboot|format|dd|>|<|sudo|su) ]]; then
96+
if [[ "$COMPOSE_ARGS" =~ (rm|kill|shutdown|reboot|format|dd|\>|\<|sudo|su) ]]; then
9797
echo "::error::Compose args contain prohibited commands: $COMPOSE_ARGS"
9898
exit 1
9999
fi

0 commit comments

Comments
 (0)