@@ -31,29 +31,49 @@ private import semmle.javascript.security.dataflow.ZipSlipCustomizations
3131 * Examples of excluded queries:
3232 * - UnsafeDynamicMethodAccess: high severity (RCE) but has way too many sinks (every callee).
3333 * - ClearTextLogging: not severe enough relative to number of sinks.
34+ *
35+ * `kind` is bound to the name of the module containing the query sinks.
3436 */
35- DataFlow:: Node relevantTaintSink ( ) {
37+ DataFlow:: Node relevantTaintSink ( string kind ) {
3638 not result .getFile ( ) instanceof IgnoredFile and
3739 (
38- result instanceof ClientSideUrlRedirect:: Sink or
39- result instanceof CodeInjection:: Sink or
40- result instanceof CommandInjection:: Sink or
41- result instanceof Xss:: Shared:: Sink or
42- result instanceof NosqlInjection:: Sink or
43- result instanceof PrototypePollution:: Sink or
44- result instanceof RegExpInjection:: Sink or
45- result instanceof RequestForgery:: Sink or
46- result instanceof ServerSideUrlRedirect:: Sink or
47- result instanceof SqlInjection:: Sink or
48- result instanceof TaintedPath:: Sink or
49- result instanceof UnsafeDeserialization:: Sink or
50- result instanceof XmlBomb:: Sink or
51- result instanceof XpathInjection:: Sink or
52- result instanceof Xxe:: Sink or
53- result instanceof ZipSlip:: Sink
40+ kind = "ClientSideUrlRedirect" and result instanceof ClientSideUrlRedirect:: Sink
41+ or
42+ kind = "CodeInjection" and result instanceof CodeInjection:: Sink
43+ or
44+ kind = "CommandInjection" and result instanceof CommandInjection:: Sink
45+ or
46+ kind = "Xss" and result instanceof Xss:: Shared:: Sink
47+ or
48+ kind = "NosqlInjection" and result instanceof NosqlInjection:: Sink
49+ or
50+ kind = "PrototypePollution" and result instanceof PrototypePollution:: Sink
51+ or
52+ kind = "RegExpInjection" and result instanceof RegExpInjection:: Sink
53+ or
54+ kind = "RequestForgery" and result instanceof RequestForgery:: Sink
55+ or
56+ kind = "ServerSideUrlRedirect" and result instanceof ServerSideUrlRedirect:: Sink
57+ or
58+ kind = "SqlInjection" and result instanceof SqlInjection:: Sink
59+ or
60+ kind = "TaintedPath" and result instanceof TaintedPath:: Sink
61+ or
62+ kind = "UnsafeDeserialization" and result instanceof UnsafeDeserialization:: Sink
63+ or
64+ kind = "XmlBomb" and result instanceof XmlBomb:: Sink
65+ or
66+ kind = "XpathInjection" and result instanceof XpathInjection:: Sink
67+ or
68+ kind = "Xxe" and result instanceof Xxe:: Sink
69+ or
70+ kind = "ZipSlip" and result instanceof ZipSlip:: Sink
5471 )
5572}
5673
74+ /** Gets a relevant taint sink. See `relevantTaintSink/1` for more information. */
75+ DataFlow:: Node relevantTaintSink ( ) { result = relevantTaintSink ( _) }
76+
5777/**
5878 * Gets a remote flow source or `document.location` source.
5979 */
0 commit comments