Skip to content

Commit 745f9b3

Browse files
committed
JS: Exclude non-code script tags
1 parent 2412f53 commit 745f9b3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

javascript/ql/src/semmle/javascript/frameworks/Templating.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ module Templating {
7777

7878
/** Holds if this occurs in a `script` tag. */
7979
predicate isInScriptTag() {
80-
getParent() instanceof HTML::ScriptElement
80+
// We want to exclude non-code scripts like JSON.
81+
toplevel_parent_xml_node(any(InlineScript scr), getParent())
8182
}
8283

8384
/**

0 commit comments

Comments
 (0)