Skip to content

Commit 74f8e77

Browse files
committed
prevent regex dos vector
1 parent 4f5686e commit 74f8e77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/secure_headers/task_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ def generate_inline_style_hashes(filename)
2929

3030
def dynamic_content?(filename, inline_script)
3131
!!(
32-
(is_mustache?(filename) && inline_script =~ /\{\{.*\}\}/) ||
33-
(is_erb?(filename) && inline_script =~ /<%.*%>/)
32+
(is_mustache?(filename) && inline_script =~ /\{\{.*?\}\}/) ||
33+
(is_erb?(filename) && inline_script =~ /<%.*?%>/)
3434
)
3535
end
3636

0 commit comments

Comments
 (0)