Skip to content

Commit

Permalink
Fixup sources.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelnebel committed Apr 23, 2024
1 parent 35aff1c commit 67d292c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
14 changes: 9 additions & 5 deletions java/ql/lib/semmle/code/java/dataflow/ApiSources.qll
Expand Up @@ -17,12 +17,14 @@ private module ApiSources {
private import semmle.code.java.security.ArbitraryApkInstallation as ArbitraryApkInstallation
private import semmle.code.java.security.CleartextStorageAndroidDatabaseQuery as CleartextStorageAndroidDatabaseQuery
private import semmle.code.java.security.CleartextStorageAndroidFilesystemQuery as CleartextStorageAndroidFilesystemQuery
private import semmle.code.java.security.CleartextStorageCookieQuery as CleartextStorageCookieQuery
private import semmle.code.java.security.CleartextStorageSharedPrefsQuery as CleartextStorageSharedPrefsQuery
private import semmle.code.java.security.ImplicitPendingIntentsQuery as ImplicitPendingIntentsQuery
private import semmle.code.java.security.ImproperIntentVerificationQuery as ImproperIntentVerificationQuery
private import semmle.code.java.security.InsecureTrustManagerQuery as InsecureTrustManagerQuery
private import semmle.code.java.security.MissingJWTSignatureCheckQuery as MissingJWTSignatureCheckQuery
private import semmle.code.java.security.InsecureTrustManager as InsecureTrustManager
private import semmle.code.java.security.JWT as Jwt
private import semmle.code.java.security.XSS as Xss

Check warning

Code scanning / CodeQL

Names only differing by case Warning

Xss is only different by casing from XSS that is used elsewhere for modules.
// TODO: Check below.
private import semmle.code.java.security.StackTraceExposureQuery as StackTraceExposureQuery
private import semmle.code.java.security.UnsafeCertTrustQuery as UnsafeCertTrustQuery
private import semmle.code.java.security.ZipSlipQuery as ZipSlipQuery
Expand All @@ -38,6 +40,9 @@ private module ApiSources {
private class CleartextStorageAndroidFilesystemQuerySources extends SourceNode instanceof CleartextStorageAndroidFilesystemQuery::LocalFileOpenCallSource
{ }

private class CleartextStorageCookieQuerySources extends SourceNode instanceof CleartextStorageCookieQuery::CookieSource
{ }

private class CleartextStorageSharedPrefsQuerySources extends SourceNode instanceof CleartextStorageSharedPrefsQuery::SharedPreferencesEditorMethodCallSource
{ }

Expand All @@ -47,11 +52,10 @@ private module ApiSources {
private class ImproperIntentVerificationQuerySources extends SourceNode instanceof ImproperIntentVerificationQuery::VerifiedIntentConfigSource
{ }

private class InsecureTrustManagerQuerySources extends SourceNode instanceof InsecureTrustManagerQuery::InsecureTrustManagerSource
private class InsecureTrustManagerSources extends SourceNode instanceof InsecureTrustManager::InsecureTrustManagerSource
{ }

private class MissingJWTSignatureCheckQuerySources extends SourceNode instanceof MissingJWTSignatureCheckQuery::JwtParserWithInsecureParseSource
{ }
private class JwtSources extends SourceNode instanceof Jwt::JwtParserWithInsecureParseSource { }

private class XssSources extends SourceNode instanceof Xss::XssVulnerableWriterSourceNode { }

Expand Down
Expand Up @@ -37,6 +37,13 @@ private predicate cookieStore(DataFlow::Node cookie, Expr store) {
)
}

/**
* A class of cookie source nodes.
*/
class CookieSource extends DataFlow::Node {
CookieSource() { this.asExpr() instanceof Cookie }
}

/**
* A class of cookie store sink nodes.
*/
Expand All @@ -45,7 +52,7 @@ class CookieStoreSink extends DataFlow::Node {
}

private module CookieToStoreFlowConfig implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node src) { src.asExpr() instanceof Cookie }
predicate isSource(DataFlow::Node src) { src instanceof CookieSource }

predicate isSink(DataFlow::Node sink) { sink instanceof CookieStoreSink }
}
Expand Down

0 comments on commit 67d292c

Please sign in to comment.