Skip to content

Commit 363ec0a

Browse files
committed
Swift: Update swift/summary/query-sinks.
1 parent 9ec08c1 commit 363ec0a

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

swift/ql/lib/codeql/swift/security/WeakPasswordHashingQuery.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import codeql.swift.security.WeakPasswordHashingExtensions
1313
* A taint tracking configuration from password expressions to inappropriate
1414
* hashing sinks.
1515
*/
16-
module WeakHashingPasswordConfig implements DataFlow::ConfigSig {
16+
module WeakPasswordHashingConfig implements DataFlow::ConfigSig {
1717
predicate isSource(DataFlow::Node node) {
1818
exists(SensitiveExpr se |
1919
node.asExpr() = se and
@@ -40,4 +40,4 @@ module WeakHashingPasswordConfig implements DataFlow::ConfigSig {
4040
}
4141
}
4242

43-
module WeakHashingFlow = TaintTracking::Global<WeakHashingPasswordConfig>;
43+
module WeakPasswordHashingFlow = TaintTracking::Global<WeakPasswordHashingConfig>;

swift/ql/src/queries/Security/CWE-328/WeakPasswordHashing.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414

1515
import swift
1616
import codeql.swift.security.WeakPasswordHashingQuery
17-
import WeakHashingFlow::PathGraph
17+
import WeakPasswordHashingFlow::PathGraph
1818

19-
from WeakHashingFlow::PathNode source, WeakHashingFlow::PathNode sink, string algorithm
19+
from WeakPasswordHashingFlow::PathNode source, WeakPasswordHashingFlow::PathNode sink, string algorithm
2020
where
21-
WeakHashingFlow::flowPath(source, sink) and
21+
WeakPasswordHashingFlow::flowPath(source, sink) and
2222
algorithm = sink.getNode().(WeakPasswordHashingSink).getAlgorithm()
2323
select sink.getNode(), source, sink,
2424
"Insecure hashing algorithm (" + algorithm + ") depends on $@.", source.getNode(),

swift/ql/src/queries/Summary/QuerySinks.ql

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ import codeql.swift.security.CleartextLoggingQuery
3030
import codeql.swift.security.CleartextStoragePreferencesQuery
3131
import codeql.swift.security.HardcodedEncryptionKeyQuery
3232
import codeql.swift.security.ECBEncryptionQuery
33-
import codeql.swift.security.WeakSensitiveDataHashingQuery
33+
import codeql.swift.security.WeakSensitiveDataHashingQuery as WeakSensitiveDataHashingQuery
34+
import codeql.swift.security.WeakPasswordHashingQuery as WeakPasswordHashingQuery
3435
import codeql.swift.security.XXEQuery
3536
import codeql.swift.security.InsecureTLSQuery
3637
import codeql.swift.security.ConstantSaltQuery
@@ -65,7 +66,9 @@ string queryForSink(DataFlow::Node sink) {
6566
or
6667
EcbEncryptionConfig::isSink(sink) and result = "swift/ecb-encryption"
6768
or
68-
WeakHashingConfig::isSink(sink) and result = "swift/weak-sensitive-data-hashing"
69+
WeakSensitiveDataHashingQuery::WeakSensitiveDataHashingConfig::isSink(sink) and result = "swift/weak-sensitive-data-hashing"
70+
or
71+
WeakPasswordHashingQuery::WeakPasswordHashingConfig::isSink(sink) and result = "swift/weak-password-hashing"
6972
or
7073
XxeConfig::isSink(sink) and result = "swift/xxe"
7174
or

0 commit comments

Comments
 (0)