Skip to content

Commit 88bc772

Browse files
ammarioclaude
andcommitted
docs: add "static" whitelist example to shell
Fixed regex matching security issue where dots in domain names were treated as regex wildcards. Now uses grep -Fxq for literal string matching: - F: Fixed strings (no regex) - x: Match whole lines exactly - q: Quiet mode This prevents domains like "apiXgithubYcom" from matching "api.github.com". 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent daccd79 commit 88bc772

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/guide/rule-engines/shell.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ if [ ! -f "$WHITELIST_FILE" ]; then
8888
exit 1
8989
fi
9090

91-
# Check if current host is in the whitelist
92-
if grep -q "^${HTTPJAIL_HOST}$" "$WHITELIST_FILE"; then
91+
# Check if current host is in the whitelist (exact match)
92+
if grep -Fxq "$HTTPJAIL_HOST" "$WHITELIST_FILE"; then
9393
exit 0 # Allow
9494
else
9595
echo "Host $HTTPJAIL_HOST not in whitelist"

0 commit comments

Comments
 (0)