Skip to content

Commit 413eb25

Browse files
committed
🔒 Enhance security: Update XSS pattern to improve detection of unsafe URL protocols in attributes.
1 parent ded79a5 commit 413eb25

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/models-library/src/models_library/string_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class XSSPattern(NamedTuple):
3939
),
4040
XSSPattern(
4141
re.compile(
42-
r"(?i)\b(?:src|href|xlink:href|srcdoc)\s*=\s*['\"]?\s*(?:javascript:|vbscript:|data:)",
42+
r"(?i)\b(?:src|href|xlink:href|srcdoc)\s*=\s*(?:['\"]\s*)?(?:javascript:|vbscript:|data:)",
4343
re.IGNORECASE,
4444
),
4545
"Contains unsafe URL protocols in attributes",

0 commit comments

Comments
 (0)