Compare commits

..

1 Commits

Author SHA1 Message Date
Claude
ae2fd1754a fix: prevent command injection in test-failure-analysis example
Fix command injection vulnerability where github.event.workflow_run.head_branch
was directly interpolated into shell commands. Branch names containing shell
metacharacters could execute arbitrary commands.

Changes:
- Pass head_branch through environment variables instead of direct interpolation
- Affects gh pr list --head and gh workflow run --ref commands
- Prevents execution of malicious code in branch names

Severity: HIGH
Category: command_injection
2025-12-13 20:47:58 +00:00

View File

@@ -53,7 +53,6 @@ jobs:
fromJSON(steps.detect.outputs.structured_output).confidence >= 0.7
env:
GH_TOKEN: ${{ github.token }}
WORKFLOW_NAME: ${{ github.event.workflow_run.name }}
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
run: |
OUTPUT='${{ steps.detect.outputs.structured_output }}'
@@ -65,7 +64,8 @@ jobs:
echo ""
echo "Triggering automatic retry..."
gh workflow run "$WORKFLOW_NAME" --ref "$HEAD_BRANCH"
gh workflow run "${{ github.event.workflow_run.name }}" \
--ref "$HEAD_BRANCH"
# Low confidence flaky detection - skip retry
- name: Low confidence detection