|
2 | 2 |
|
3 | 3 | private import semmle.code.java.dataflow.DataFlow |
4 | 4 | private import semmle.code.java.dataflow.ExternalFlow |
| 5 | +private import semmle.code.java.dataflow.FlowSources as FlowSources |
5 | 6 |
|
6 | | -/** |
7 | | - * A data flow source node. |
8 | | - */ |
9 | | -abstract class SourceNode extends DataFlow::Node { } |
| 7 | +class SourceNode = FlowSources::ApiSourceNode; |
10 | 8 |
|
11 | 9 | /** |
12 | 10 | * Module that adds all API like sources to `SourceNode`, excluding some sources for cryptography based |
13 | 11 | * queries, and queries where sources are not succifiently defined (eg. using broad method name matching). |
14 | 12 | */ |
15 | | -private module ApiSources { |
16 | | - private import FlowSources as FlowSources |
17 | | - private import semmle.code.java.security.ArbitraryApkInstallation as ArbitraryApkInstallation |
18 | | - private import semmle.code.java.security.CleartextStorageAndroidDatabaseQuery as CleartextStorageAndroidDatabaseQuery |
19 | | - private import semmle.code.java.security.CleartextStorageAndroidFilesystemQuery as CleartextStorageAndroidFilesystemQuery |
20 | | - private import semmle.code.java.security.CleartextStorageCookieQuery as CleartextStorageCookieQuery |
21 | | - private import semmle.code.java.security.CleartextStorageSharedPrefsQuery as CleartextStorageSharedPrefsQuery |
22 | | - private import semmle.code.java.security.ImplicitPendingIntentsQuery as ImplicitPendingIntentsQuery |
23 | | - private import semmle.code.java.security.ImproperIntentVerificationQuery as ImproperIntentVerificationQuery |
24 | | - private import semmle.code.java.security.InsecureTrustManager as InsecureTrustManager |
25 | | - private import semmle.code.java.security.JWT as Jwt |
26 | | - private import semmle.code.java.security.StackTraceExposureQuery as StackTraceExposureQuery |
27 | | - private import semmle.code.java.security.ZipSlipQuery as ZipSlipQuery |
28 | | - |
29 | | - private class FlowSourcesSourceNode extends SourceNode instanceof FlowSources::SourceNode { } |
30 | | - |
31 | | - private class ArbitraryApkInstallationSources extends SourceNode instanceof ArbitraryApkInstallation::ExternalApkSource |
32 | | - { } |
33 | | - |
34 | | - private class CleartextStorageAndroidDatabaseQuerySources extends SourceNode instanceof CleartextStorageAndroidDatabaseQuery::LocalDatabaseOpenMethodCallSource |
35 | | - { } |
36 | | - |
37 | | - private class CleartextStorageAndroidFilesystemQuerySources extends SourceNode instanceof CleartextStorageAndroidFilesystemQuery::LocalFileOpenCallSource |
38 | | - { } |
39 | | - |
40 | | - private class CleartextStorageCookieQuerySources extends SourceNode instanceof CleartextStorageCookieQuery::CookieSource |
41 | | - { } |
42 | | - |
43 | | - private class CleartextStorageSharedPrefsQuerySources extends SourceNode instanceof CleartextStorageSharedPrefsQuery::SharedPreferencesEditorMethodCallSource |
44 | | - { } |
45 | | - |
46 | | - private class ImplicitPendingIntentsQuerySources extends SourceNode instanceof ImplicitPendingIntentsQuery::ImplicitPendingIntentSource |
47 | | - { } |
48 | | - |
49 | | - private class ImproperIntentVerificationQuerySources extends SourceNode instanceof ImproperIntentVerificationQuery::VerifiedIntentConfigSource |
50 | | - { } |
51 | | - |
52 | | - private class InsecureTrustManagerSources extends SourceNode instanceof InsecureTrustManager::InsecureTrustManagerSource |
53 | | - { } |
54 | | - |
55 | | - private class JwtSources extends SourceNode instanceof Jwt::JwtParserWithInsecureParseSource { } |
56 | | - |
57 | | - private class StackTraceExposureQuerySources extends SourceNode instanceof StackTraceExposureQuery::GetMessageFlowSource |
58 | | - { } |
59 | | - |
60 | | - private class ZipSlipQuerySources extends SourceNode instanceof ZipSlipQuery::ArchiveEntryNameMethodSource |
61 | | - { } |
| 13 | +private module AllApiSources { |
| 14 | + private import semmle.code.java.security.ArbitraryApkInstallation |
| 15 | + private import semmle.code.java.security.CleartextStorageAndroidDatabaseQuery |
| 16 | + private import semmle.code.java.security.CleartextStorageAndroidFilesystemQuery |
| 17 | + private import semmle.code.java.security.CleartextStorageCookieQuery |
| 18 | + private import semmle.code.java.security.CleartextStorageSharedPrefsQuery |
| 19 | + private import semmle.code.java.security.ImplicitPendingIntentsQuery |
| 20 | + private import semmle.code.java.security.ImproperIntentVerificationQuery |
| 21 | + private import semmle.code.java.security.InsecureTrustManager |
| 22 | + private import semmle.code.java.security.JWT |
| 23 | + private import semmle.code.java.security.StackTraceExposureQuery |
| 24 | + private import semmle.code.java.security.ZipSlipQuery |
| 25 | + |
| 26 | + private class AddSourceNode extends SourceNode instanceof FlowSources::SourceNode { } |
62 | 27 |
|
63 | 28 | /** |
64 | 29 | * Add all models as data sources. |
65 | 30 | */ |
66 | | - private class SourceNodeExternal extends SourceNode { |
67 | | - SourceNodeExternal() { sourceNode(this, _) } |
| 31 | + private class ApiSourceNodeExternal extends SourceNode { |
| 32 | + ApiSourceNodeExternal() { sourceNode(this, _) } |
68 | 33 | } |
69 | 34 | } |
0 commit comments