Skip to content

Commit dc516fe

Browse files
authored
Merge pull request DeusData#2648 from DeusData/fix/audit-wget-token
fix(security): allow the bare wget token the shell pass compares
2 parents 8df0639 + d21693d commit dc516fe

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

‎scripts/security-strings.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ DANGEROUS_CMDS='wget|netcat|ncat|/dev/tcp|telnet'
246246
# evaluation. Document the source so reviewers can verify the false positive.
247247
ALLOWED_DANGEROUS=(
248248
'^telnet$' # rst tree-sitter grammar: valid_schemas[] in vendored/grammars/rst/tree_sitter_rst/chars.c
249+
'^wget$' # src/pipeline/pass_shell.c: the program name a script's curl / wget HTTP_CALLS compares and records as `via`
249250
)
250251
if grep -wE "$DANGEROUS_CMDS" "$STRINGS_FILE" > "$SEC_CMDS" 2>/dev/null && [ -s "$SEC_CMDS" ]; then
251252
for allow in "${ALLOWED_DANGEROUS[@]}"; do

‎tests/test_security_strings_allowlist.sh‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,12 @@ done
170170
# content, not all tokenizer arrays or all boolean password assignments.
171171
make_fixture "$TMP/lookalike.bin" 'const keywords=["wget","telnet"];'
172172
assert_audit 1 "$COMMAND_BLOCKED" 'unreviewed command keyword array is blocked' "$TMP/lookalike.bin"
173+
# pass_shell.c compares a script's program name with the bare string "wget" (its
174+
# curl / wget HTTP_CALLS). Only that whole line is exempt; a command is not.
175+
make_fixture "$TMP/token.bin" 'wget'
176+
assert_audit 0 "$AUDIT_PASSED" 'bare wget token (pass_shell.c program name) is allowed' "$TMP/token.bin"
177+
make_fixture "$TMP/token.bin" 'wget -O /tmp/payload'
178+
assert_audit 1 "$COMMAND_BLOCKED" 'a wget command line remains blocked' "$TMP/token.bin"
173179
make_fixture "$TMP/lookalike.bin" 'this.password=!1;'
174180
assert_audit 1 "$CREDENTIAL_BLOCKED" 'unreviewed boolean password assignment is blocked' "$TMP/lookalike.bin"
175181

0 commit comments

Comments
 (0)