Skip to content

Commit da7032d

Browse files
Add qldoc
1 parent ea3db5d commit da7032d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

java/ql/lib/semmle/code/java/security/AndroidCertificatePinningQuery.qll

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
/** Definitiona for the Android Missing Certificate Pinning query. */
1+
/** Definitions for the Android Missing Certificate Pinning query. */
22

33
import java
44
import semmle.code.xml.AndroidManifest
55
import semmle.code.java.dataflow.TaintTracking
66
import HttpsUrls
77

8+
/** An Android Network Security Configuration XML file. */
89
class AndroidNetworkSecurityConfigFile extends XmlFile {
910
AndroidNetworkSecurityConfigFile() {
1011
exists(AndroidApplicationXmlElement app, AndroidXmlAttribute confAttr, string confName |
@@ -16,8 +17,10 @@ class AndroidNetworkSecurityConfigFile extends XmlFile {
1617
}
1718
}
1819

20+
/** Holds if this database is of an Android application. */
1921
predicate isAndroid() { exists(AndroidManifestXmlFile m) }
2022

23+
/** Holds if the given domain name is trusted by the Network Security Configuration XML file. */
2124
predicate trustedDomain(string domainName) {
2225
exists(
2326
AndroidNetworkSecurityConfigFile confFile, XmlElement domConf, XmlElement domain,
@@ -33,6 +36,7 @@ predicate trustedDomain(string domainName) {
3336
)
3437
}
3538

39+
/** Configuration for finding uses of non trusted URLs. */
3640
private class UntrustedUrlConfig extends TaintTracking::Configuration {
3741
UntrustedUrlConfig() { this = "UntrustedUrlConfig" }
3842

@@ -47,6 +51,7 @@ private class UntrustedUrlConfig extends TaintTracking::Configuration {
4751
override predicate isSink(DataFlow::Node node) { node instanceof UrlOpenSink }
4852
}
4953

54+
/** Holds if `node` is a network communication call for which certificate pinning is not implemented. */
5055
predicate missingPinning(DataFlow::Node node) {
5156
isAndroid() and
5257
node instanceof UrlOpenSink and

0 commit comments

Comments
 (0)