|
10 | 10 |
|
11 | 11 | private import python
|
12 | 12 | private import semmle.python.dataflow.new.DataFlow
|
13 |
| -private import meta.MetaMetrics |
14 |
| -import semmle.python.security.dataflow.CleartextLoggingCustomizations |
15 |
| -import semmle.python.security.dataflow.CleartextStorageCustomizations |
16 |
| -import semmle.python.security.dataflow.CodeInjectionCustomizations |
17 |
| -import semmle.python.security.dataflow.CommandInjectionCustomizations |
18 |
| -import semmle.python.security.dataflow.LdapInjectionCustomizations |
19 |
| -import semmle.python.security.dataflow.LogInjectionCustomizations |
20 |
| -import semmle.python.security.dataflow.NoSqlInjectionCustomizations |
21 |
| -import semmle.python.security.dataflow.PathInjectionCustomizations |
22 |
| -import semmle.python.security.dataflow.PolynomialReDoSCustomizations |
23 |
| -import semmle.python.security.dataflow.ReflectedXSSCustomizations |
24 |
| -import semmle.python.security.dataflow.RegexInjectionCustomizations |
25 |
| -import semmle.python.security.dataflow.ServerSideRequestForgeryCustomizations |
26 |
| -import semmle.python.security.dataflow.SqlInjectionCustomizations |
27 |
| -import semmle.python.security.dataflow.StackTraceExposureCustomizations |
28 |
| -import semmle.python.security.dataflow.TarSlipCustomizations |
29 |
| -import semmle.python.security.dataflow.UnsafeDeserializationCustomizations |
30 |
| -import semmle.python.security.dataflow.UrlRedirectCustomizations |
31 |
| -import semmle.python.security.dataflow.WeakSensitiveDataHashingCustomizations |
32 |
| -import semmle.python.security.dataflow.XmlBombCustomizations |
33 |
| -import semmle.python.security.dataflow.XpathInjectionCustomizations |
34 |
| -import semmle.python.security.dataflow.XxeCustomizations |
35 |
| - |
36 |
| -DataFlow::Node relevantTaintSink(string kind) { |
37 |
| - not result.getLocation().getFile() instanceof IgnoredFile and |
38 |
| - ( |
39 |
| - kind = "CleartextLogging" and result instanceof CleartextLogging::Sink |
40 |
| - or |
41 |
| - kind = "CleartextStorage" and result instanceof CleartextStorage::Sink |
42 |
| - or |
43 |
| - kind = "CodeInjection" and result instanceof CodeInjection::Sink |
44 |
| - or |
45 |
| - kind = "CommandInjection" and result instanceof CommandInjection::Sink |
46 |
| - or |
47 |
| - kind = "LdapInjection (DN)" and result instanceof LdapInjection::DnSink |
48 |
| - or |
49 |
| - kind = "LdapInjection (Filter)" and result instanceof LdapInjection::FilterSink |
50 |
| - or |
51 |
| - kind = "LogInjection" and result instanceof LogInjection::Sink |
52 |
| - or |
53 |
| - kind = "PathInjection" and result instanceof PathInjection::Sink |
54 |
| - or |
55 |
| - kind = "PolynomialReDoS" and result instanceof PolynomialReDoS::Sink |
56 |
| - or |
57 |
| - kind = "ReflectedXss" and result instanceof ReflectedXss::Sink |
58 |
| - or |
59 |
| - kind = "RegexInjection" and result instanceof RegexInjection::Sink |
60 |
| - or |
61 |
| - kind = "NoSqlInjection (string sink)" and result instanceof NoSqlInjection::StringSink |
62 |
| - or |
63 |
| - kind = "NoSqlInjection (dict sink)" and result instanceof NoSqlInjection::DictSink |
64 |
| - or |
65 |
| - kind = "ServerSideRequestForgery" and result instanceof ServerSideRequestForgery::Sink |
66 |
| - or |
67 |
| - kind = "SqlInjection" and result instanceof SqlInjection::Sink |
68 |
| - or |
69 |
| - kind = "StackTraceExposure" and result instanceof StackTraceExposure::Sink |
70 |
| - or |
71 |
| - kind = "TarSlip" and result instanceof TarSlip::Sink |
72 |
| - or |
73 |
| - kind = "UnsafeDeserialization" and result instanceof UnsafeDeserialization::Sink |
74 |
| - or |
75 |
| - kind = "UrlRedirect" and result instanceof UrlRedirect::Sink |
76 |
| - or |
77 |
| - kind = "WeakSensitiveDataHashing (NormalHashFunction)" and |
78 |
| - result instanceof NormalHashFunction::Sink |
79 |
| - or |
80 |
| - kind = "WeakSensitiveDataHashing (ComputationallyExpensiveHashFunction)" and |
81 |
| - result instanceof ComputationallyExpensiveHashFunction::Sink |
82 |
| - or |
83 |
| - kind = "XmlBomb" and result instanceof XmlBomb::Sink |
84 |
| - or |
85 |
| - kind = "XpathInjection" and result instanceof XpathInjection::Sink |
86 |
| - or |
87 |
| - kind = "Xxe" and result instanceof Xxe::Sink |
88 |
| - ) |
89 |
| -} |
| 13 | +private import Sinks |
90 | 14 |
|
91 | 15 | from string kind
|
92 |
| -select relevantTaintSink(kind), kind + " sink" |
| 16 | +select taintSink(kind), kind + " sink" |
0 commit comments