fix: apply hidden_div regex newline bypass fix to skills_guard.py
The same .* pattern vulnerable to newline bypass that was fixed in prompt_builder.py (PR #6925) also existed in skills_guard.py. Changed to [\s\S]*? to match across newlines.
This commit is contained in:
@ -190,7 +190,7 @@ THREAT_PATTERNS = [
|
||||
(r'<!--[^>]*(?:ignore|override|system|secret|hidden)[^>]*-->',
|
||||
"html_comment_injection", "high", "injection",
|
||||
"hidden instructions in HTML comments"),
|
||||
(r'<\s*div\s+style\s*=\s*["\'].*display\s*:\s*none',
|
||||
(r'<\s*div\s+style\s*=\s*["\'][\s\S]*?display\s*:\s*none',
|
||||
"hidden_div", "high", "injection",
|
||||
"hidden HTML div (invisible instructions)"),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user