From 987a79fdd145d7bd8f2e888bcd6b04eb4e45dc44 Mon Sep 17 00:00:00 2001 From: geeknik <466878+geeknik@users.noreply.github.com> Date: Wed, 9 Aug 2023 13:32:25 +0000 Subject: [PATCH] Update avoid-document-write-innerhtml.yaml Changes: - Use `matchers-condition: and` to require both document.write and innerHTML matches - Split the document.write and innerHTML regexes into separate matchers - The extractors stay the same to extract any usage of either This makes the template more targeted by requiring both risky functions to be present before triggering a match. --- avoid-document-write-innerhtml.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/avoid-document-write-innerhtml.yaml b/avoid-document-write-innerhtml.yaml index 10dc7ea..472407a 100644 --- a/avoid-document-write-innerhtml.yaml +++ b/avoid-document-write-innerhtml.yaml @@ -10,10 +10,14 @@ file: - extensions: - js + matchers-condition: and matchers: - type: regex regex: - - "(document\\.write|innerHTML)" + - "document\\.write" + - type: regex + regex: + - "innerHTML" extractors: - type: regex @@ -21,4 +25,3 @@ file: name: extracted_script regex: - "(document\\.write|innerHTML)" -