Skip to content

Commit cc569d0

Browse files
committed
Add test for safe handling of options (command injection fix)
Adds a workflow test to verify that options with special characters are safely handled, validating the command injection fix in submodule scanning.
1 parent 50d2692 commit cc569d0

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/test-scan.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,11 @@ jobs:
5252
run: |
5353
output=$(docker run --rm -v $GITHUB_WORKSPACE:/scandir gitavscan /gitscan.sh --unknown-option || true)
5454
echo "$output" | grep "OPTIONS:"
55+
56+
- name: Test options with special characters are safely handled
57+
run: |
58+
# Verify that options with shell metacharacters don't cause injection
59+
# This tests the fix for command injection in submodule scanning
60+
output=$(docker run --rm -v $GITHUB_WORKSPACE:/scandir gitavscan /gitscan.sh --options "--max-filesize=1M" 2>&1 || true)
61+
# Should complete without shell errors - if injection occurred, we'd see errors
62+
echo "$output" | grep -v "syntax error" | grep -v "unexpected"

0 commit comments

Comments
 (0)