File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
javascript/ql/src/experimental/Security/CWE-020 Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -17,14 +17,12 @@ import semmle.javascript.security.dataflow.DOM
17
17
/**
18
18
* A method call for the insecure functions used to verify the `MessageEvent.origin`.
19
19
*/
20
- class InsufficientOriginChecks extends DataFlow:: MethodCallNode {
20
+ class InsufficientOriginChecks extends DataFlow:: Node {
21
21
InsufficientOriginChecks ( ) {
22
- exists ( string name | name = getMethodName ( ) |
23
- name = "indexOf" or
24
- name = "includes" or
25
- name = "endsWith" or
26
- name = "startsWith" or
27
- name = "lastIndexOf"
22
+ exists ( DataFlow:: Node node |
23
+ this .( StringOps:: StartsWith ) .getSubstring ( ) = node or
24
+ this .( StringOps:: Includes ) .getSubstring ( ) = node or
25
+ this .( StringOps:: EndsWith ) .getSubstring ( ) = node
28
26
)
29
27
}
30
28
}
You can’t perform that action at this time.
0 commit comments