|
1 | 1 | /** Provides classes representing various flow sources for data flow / taint tracking. */ |
2 | 2 |
|
3 | | -private import semmle.code.csharp.dataflow.internal.ExternalFlow |
| 3 | +private import FlowSources as FlowSources |
4 | 4 |
|
5 | | -/** |
6 | | - * A data flow source node. |
7 | | - */ |
8 | | -abstract class SourceNode extends DataFlow::Node { } |
| 5 | +final class SourceNode = FlowSources::SourceNode; |
9 | 6 |
|
10 | 7 | /** |
11 | | - * Module that adds all sources to `SourceNode`, excluding source for cryptography based |
12 | | - * queries, and queries where sources are not succifiently explicit or mainly hardcoded constants. |
| 8 | + * Module that adds all API like sources to `SourceNode`, excluding some sources for cryptography based |
| 9 | + * queries, and queries where sources are not succifiently defined (eg. using broad method name matching). |
13 | 10 | */ |
14 | | -private module AllSources { |
15 | | - private import FlowSources as FlowSources |
16 | | - private import semmle.code.csharp.security.cryptography.HardcodedSymmetricEncryptionKey |
17 | | - private import semmle.code.csharp.security.dataflow.CleartextStorageQuery as CleartextStorageQuery |
18 | | - private import semmle.code.csharp.security.dataflow.CodeInjectionQuery as CodeInjectionQuery |
| 11 | +private module AllApiSources { |
19 | 12 | private import semmle.code.csharp.security.dataflow.ConditionalBypassQuery as ConditionalBypassQuery |
20 | | - private import semmle.code.csharp.security.dataflow.ExposureOfPrivateInformationQuery as ExposureOfPrivateInformationQuery |
21 | | - private import semmle.code.csharp.security.dataflow.HardcodedCredentialsQuery as HardcodedCredentialsQuery |
22 | | - private import semmle.code.csharp.security.dataflow.LDAPInjectionQuery as LdapInjectionQuery |
23 | | - private import semmle.code.csharp.security.dataflow.LogForgingQuery as LogForgingQuery |
24 | | - private import semmle.code.csharp.security.dataflow.MissingXMLValidationQuery as MissingXmlValidationQuery |
25 | | - private import semmle.code.csharp.security.dataflow.ReDoSQuery as ReDosQuery |
26 | | - private import semmle.code.csharp.security.dataflow.RegexInjectionQuery as RegexInjectionQuery |
27 | | - private import semmle.code.csharp.security.dataflow.ResourceInjectionQuery as ResourceInjectionQuery |
28 | | - private import semmle.code.csharp.security.dataflow.SqlInjectionQuery as SqlInjectionQuery |
29 | | - private import semmle.code.csharp.security.dataflow.TaintedPathQuery as TaintedPathQuery |
30 | | - private import semmle.code.csharp.security.dataflow.UnsafeDeserializationQuery as UnsafeDeserializationQuery |
31 | | - private import semmle.code.csharp.security.dataflow.UrlRedirectQuery as UrlRedirectQuery |
32 | | - private import semmle.code.csharp.security.dataflow.XMLEntityInjectionQuery as XmlEntityInjectionQuery |
33 | | - private import semmle.code.csharp.security.dataflow.XPathInjectionQuery as XpathInjectionQuery |
34 | 13 | private import semmle.code.csharp.security.dataflow.ZipSlipQuery as ZipSlipQuery |
35 | | - |
36 | | - private class FlowSourcesSources extends SourceNode instanceof FlowSources::SourceNode { } |
37 | | - |
38 | | - private class CodeInjectionSource extends SourceNode instanceof CodeInjectionQuery::Source { } |
39 | | - |
40 | | - private class ConditionalBypassSource extends SourceNode instanceof ConditionalBypassQuery::Source |
41 | | - { } |
42 | | - |
43 | | - private class LdapInjectionSource extends SourceNode instanceof LdapInjectionQuery::Source { } |
44 | | - |
45 | | - private class LogForgingSource extends SourceNode instanceof LogForgingQuery::Source { } |
46 | | - |
47 | | - private class MissingXmlValidationSource extends SourceNode instanceof MissingXmlValidationQuery::Source |
48 | | - { } |
49 | | - |
50 | | - private class ReDosSource extends SourceNode instanceof ReDosQuery::Source { } |
51 | | - |
52 | | - private class RegexInjectionSource extends SourceNode instanceof RegexInjectionQuery::Source { } |
53 | | - |
54 | | - private class ResourceInjectionSource extends SourceNode instanceof ResourceInjectionQuery::Source |
55 | | - { } |
56 | | - |
57 | | - private class SqlInjectionSource extends SourceNode instanceof SqlInjectionQuery::Source { } |
58 | | - |
59 | | - private class TaintedPathSource extends SourceNode instanceof TaintedPathQuery::Source { } |
60 | | - |
61 | | - private class UnsafeDeserializationSource extends SourceNode instanceof UnsafeDeserializationQuery::Source |
62 | | - { } |
63 | | - |
64 | | - private class UrlRedirectSource extends SourceNode instanceof UrlRedirectQuery::Source { } |
65 | | - |
66 | | - private class XmlEntityInjectionSource extends SourceNode instanceof XmlEntityInjectionQuery::Source |
67 | | - { } |
68 | | - |
69 | | - private class XpathInjectionSource extends SourceNode instanceof XpathInjectionQuery::Source { } |
70 | | - |
71 | | - /** |
72 | | - * Add all models as data sources. |
73 | | - */ |
74 | | - private class SourceNodeExternal extends SourceNode { |
75 | | - SourceNodeExternal() { sourceNode(this, _) } |
76 | | - } |
77 | 14 | } |
0 commit comments