|
| 1 | +/** Provides classes representing various flow sinks for data flow / taint tracking. */ |
| 2 | + |
| 3 | +private import semmle.code.csharp.dataflow.internal.ExternalFlow |
| 4 | + |
| 5 | +/** |
| 6 | + * Module that adds all sinks to `SinkNode`, excluding sinks for cryptography based |
| 7 | + * queries, and queries where sinks are not succifiently explicit. |
| 8 | + */ |
| 9 | +private module AllSinks { |
| 10 | + private import ParallelSink as ParallelSink |
| 11 | + private import Remote as Remote |
| 12 | + private import semmle.code.csharp.security.dataflow.CodeInjectionQuery as CodeInjectionQuery |
| 13 | + private import semmle.code.csharp.security.dataflow.ConditionalBypassQuery as ConditionalBypassQuery |
| 14 | + private import semmle.code.csharp.security.dataflow.ExposureOfPrivateInformationQuery as ExposureOfPrivateInformationQuery |
| 15 | + private import semmle.code.csharp.security.dataflow.HardcodedCredentialsQuery as HardcodedCredentialsQuery |
| 16 | + private import semmle.code.csharp.security.dataflow.LDAPInjectionQuery as LdapInjectionQuery |
| 17 | + private import semmle.code.csharp.security.dataflow.LogForgingQuery as LogForgingQuery |
| 18 | + private import semmle.code.csharp.security.dataflow.MissingXMLValidationQuery as MissingXmlValidationQuery |
| 19 | + private import semmle.code.csharp.security.dataflow.ReDoSQuery as ReDosQuery |
| 20 | + private import semmle.code.csharp.security.dataflow.RegexInjectionQuery as RegexInjectionQuery |
| 21 | + private import semmle.code.csharp.security.dataflow.ResourceInjectionQuery as ResourceInjectionQuery |
| 22 | + private import semmle.code.csharp.security.dataflow.SqlInjectionQuery as SqlInjectionQuery |
| 23 | + private import semmle.code.csharp.security.dataflow.TaintedPathQuery as TaintedPathQuery |
| 24 | + private import semmle.code.csharp.security.dataflow.UnsafeDeserializationQuery as UnsafeDeserializationQuery |
| 25 | + private import semmle.code.csharp.security.dataflow.UrlRedirectQuery as UrlRedirectQuery |
| 26 | + private import semmle.code.csharp.security.dataflow.XMLEntityInjectionQuery as XmlEntityInjectionQuery |
| 27 | + private import semmle.code.csharp.security.dataflow.XPathInjectionQuery as XpathInjectionQuery |
| 28 | + private import semmle.code.csharp.security.dataflow.XSSSinks as XssSinks |
| 29 | + private import semmle.code.csharp.security.dataflow.ZipSlipQuery as ZipSlipQuery |
| 30 | + |
| 31 | + private class ParallelSink extends SinkNode instanceof ParallelSink::ParallelSink { } |
| 32 | + |
| 33 | + private class RemoteSinkFlowSinks extends SinkNode instanceof Remote::RemoteFlowSink { } |
| 34 | + |
| 35 | + private class CodeInjectionSink extends SinkNode instanceof CodeInjectionQuery::Sink { } |
| 36 | + |
| 37 | + private class ConditionalBypassSink extends SinkNode instanceof ConditionalBypassQuery::Sink { } |
| 38 | + |
| 39 | + private class ExposureOfPrivateInformationSink extends SinkNode instanceof ExposureOfPrivateInformationQuery::Sink |
| 40 | + { } |
| 41 | + |
| 42 | + private class HardcodedCredentialsSink extends SinkNode instanceof HardcodedCredentialsQuery::Sink |
| 43 | + { } |
| 44 | + |
| 45 | + private class LdapInjectionSink extends SinkNode instanceof LdapInjectionQuery::Sink { } |
| 46 | + |
| 47 | + private class LogForgingSink extends SinkNode instanceof LogForgingQuery::Sink { } |
| 48 | + |
| 49 | + private class MissingXmlValidationSink extends SinkNode instanceof MissingXmlValidationQuery::Sink |
| 50 | + { } |
| 51 | + |
| 52 | + private class ReDosSink extends SinkNode instanceof ReDosQuery::Sink { } |
| 53 | + |
| 54 | + private class RegexInjectionSink extends SinkNode instanceof RegexInjectionQuery::Sink { } |
| 55 | + |
| 56 | + private class ResourceInjectionSink extends SinkNode instanceof ResourceInjectionQuery::Sink { } |
| 57 | + |
| 58 | + private class SqlInjectionSink extends SinkNode instanceof SqlInjectionQuery::Sink { } |
| 59 | + |
| 60 | + private class TaintedPathSink extends SinkNode instanceof TaintedPathQuery::Sink { } |
| 61 | + |
| 62 | + private class UnsafeDeserializationSink extends SinkNode instanceof UnsafeDeserializationQuery::Sink |
| 63 | + { } |
| 64 | + |
| 65 | + private class UrlRedirectSink extends SinkNode instanceof UrlRedirectQuery::Sink { } |
| 66 | + |
| 67 | + private class XmlEntityInjectionSink extends SinkNode instanceof XmlEntityInjectionQuery::Sink { } |
| 68 | + |
| 69 | + private class XpathInjectionSink extends SinkNode instanceof XpathInjectionQuery::Sink { } |
| 70 | + |
| 71 | + private class XssSink extends SinkNode instanceof XssSinks::Sink { } |
| 72 | + |
| 73 | + /** |
| 74 | + * Add all models as data sinks. |
| 75 | + */ |
| 76 | + private class SinkNodeExternal extends SinkNode { |
| 77 | + SinkNodeExternal() { sinkNode(this, _) } |
| 78 | + } |
| 79 | +} |
| 80 | + |
| 81 | +/** |
| 82 | + * A data flow sink node. |
| 83 | + */ |
| 84 | +abstract class SinkNode extends DataFlow::Node { } |
0 commit comments