Merge pull request #2324 from cbxcvl/fix/renderer-redos

fix(renderer): remove ambiguous \s* from _BLOCK_RE to prevent ReDoS
This commit is contained in:
Lysec
2026-03-31 02:52:40 +02:00
committed by GitHub
+1 -1
View File
@@ -138,7 +138,7 @@ class TemplateRenderer:
COLOR_ARG_FILTERS = {"blend", "harmonize"}
# Regex for block delimiters: <* ... *>
_BLOCK_RE = re.compile(r'<\*\s*(.*?)\s*\*>', re.DOTALL)
_BLOCK_RE = re.compile(r'<\*(.*?)\*>', re.DOTALL)
# Regex for expression tags: {{ ... }}
_EXPR_RE = re.compile(r"\{\{([^}\n]+?)\}\}")