Skip to content

Commit 8877172

Browse files
committed
fix: Exclude Redis eval() from security audit
Redis client.eval() is a legitimate Redis EVAL command, not Python's dangerous eval(). Updated pattern to exclude: - redis_client.eval() - redisClient.eval() - redis.eval() Results: - CRITICAL: 16 → 14 (85.4% reduction from original 96) - Total: 2758 → 2756 This fixes 2 false positives in API rate limiting examples.
1 parent 6048ff9 commit 8877172

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tests/security_audit.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ def __init__(self, verbose: bool = False):
8484

8585
# Command injection patterns
8686
self.injection_patterns = {
87-
r'\beval\s*\(': ('CRITICAL', 'eval() usage',
87+
# eval() usage - but NOT redis_client.eval() or redisClient.eval() or redis.eval()
88+
r'(?<!redis_client\.)\b(?<!redisClient\.)\b(?<!redis\.)\beval\s*\(': ('CRITICAL', 'eval() usage',
8889
'Never use eval() with user input'),
8990
# exec() in Python or require('child_process').exec() in JS/TS
9091
# BUT NOT regex.exec() in JavaScript

0 commit comments

Comments
 (0)