We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c490cfd commit 71a7ec5Copy full SHA for 71a7ec5
1 file changed
javascript/ql/src/experimental/Security/CWE-020/PostMessageNoOriginCheck.ql
@@ -17,14 +17,12 @@ import semmle.javascript.security.dataflow.DOM
17
/**
18
* A method call for the insecure functions used to verify the `MessageEvent.origin`.
19
*/
20
-class InsufficientOriginChecks extends DataFlow::MethodCallNode {
+class InsufficientOriginChecks extends DataFlow::Node {
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"
+ exists(DataFlow::Node node |
+ this.(StringOps::StartsWith).getSubstring() = node or
+ this.(StringOps::Includes).getSubstring() = node or
+ this.(StringOps::EndsWith).getSubstring() = node
28
)
29
}
30
0 commit comments