Skip to content

Commit d92ecbb

Browse files
committed
Swift: Standardize on 'barrier' tover 'santerminology now we use ConfigSig dataflow.
1 parent 2923993 commit d92ecbb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+80
-86
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ private import codeql.swift.security.SensitiveExprs
88
/** A data flow sink for cleartext logging of sensitive data vulnerabilities. */
99
abstract class CleartextLoggingSink extends DataFlow::Node { }
1010

11-
/** A sanitizer for cleartext logging of sensitive data vulnerabilities. */
12-
abstract class CleartextLoggingSanitizer extends DataFlow::Node { }
11+
/** A barrier for cleartext logging of sensitive data vulnerabilities. */
12+
abstract class CleartextLoggingBarrier extends DataFlow::Node { }
1313

1414
/**
1515
* A unit class for adding additional taint steps.
@@ -33,12 +33,12 @@ private class DefaultCleartextLoggingSink extends CleartextLoggingSink {
3333
}
3434

3535
/**
36-
* A sanitizer for `OSLogMessage`s configured with the appropriate privacy option.
36+
* A barrier for `OSLogMessage`s configured with the appropriate privacy option.
3737
* Numeric and boolean arguments aren't redacted unless the `private` or `sensitive` options are used.
3838
* Arguments of other types are always redacted unless the `public` option is used.
3939
*/
40-
private class OsLogPrivacyCleartextLoggingSanitizer extends CleartextLoggingSanitizer {
41-
OsLogPrivacyCleartextLoggingSanitizer() {
40+
private class OsLogPrivacyCleartextLoggingBarrier extends CleartextLoggingBarrier {
41+
OsLogPrivacyCleartextLoggingBarrier() {
4242
exists(CallExpr c, AutoClosureExpr e |
4343
c.getStaticTarget().getName().matches("appendInterpolation(_:%privacy:%)") and
4444
c.getArgument(0).getExpr() = e and

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module CleartextLoggingConfig implements DataFlow::ConfigSig {
1717

1818
predicate isSink(DataFlow::Node sink) { sink instanceof CleartextLoggingSink }
1919

20-
predicate isBarrier(DataFlow::Node sanitizer) { sanitizer instanceof CleartextLoggingSanitizer }
20+
predicate isBarrier(DataFlow::Node barrier) { barrier instanceof CleartextLoggingBarrier }
2121

2222
// Disregard paths that contain other paths. This helps with performance.
2323
predicate isBarrierIn(DataFlow::Node node) { isSource(node) }

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import codeql.swift.dataflow.ExternalFlow
1515
abstract class CleartextStorageDatabaseSink extends DataFlow::Node { }
1616

1717
/**
18-
* A sanitizer for cleartext database storage vulnerabilities.
18+
* A barrier for cleartext database storage vulnerabilities.
1919
*/
20-
abstract class CleartextStorageDatabaseSanitizer extends DataFlow::Node { }
20+
abstract class CleartextStorageDatabaseBarrier extends DataFlow::Node { }
2121

2222
/**
2323
* A unit class for adding additional taint steps.
@@ -114,10 +114,10 @@ private class CleartextStorageDatabaseSinks extends SinkModelCsv {
114114
}
115115

116116
/**
117-
* An encryption sanitizer for cleartext database storage vulnerabilities.
117+
* An encryption barrier for cleartext database storage vulnerabilities.
118118
*/
119-
private class CleartextStorageDatabaseEncryptionSanitizer extends CleartextStorageDatabaseSanitizer {
120-
CleartextStorageDatabaseEncryptionSanitizer() { this.asExpr() instanceof EncryptedExpr }
119+
private class CleartextStorageDatabaseEncryptionBarrier extends CleartextStorageDatabaseBarrier {
120+
CleartextStorageDatabaseEncryptionBarrier() { this.asExpr() instanceof EncryptedExpr }
121121
}
122122

123123
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ module CleartextStorageDatabaseConfig implements DataFlow::ConfigSig {
1818

1919
predicate isSink(DataFlow::Node node) { node instanceof CleartextStorageDatabaseSink }
2020

21-
predicate isBarrier(DataFlow::Node sanitizer) {
22-
sanitizer instanceof CleartextStorageDatabaseSanitizer
21+
predicate isBarrier(DataFlow::Node barrier) {
22+
barrier instanceof CleartextStorageDatabaseBarrier
2323
}
2424

2525
predicate isAdditionalFlowStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) {

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ abstract class CleartextStoragePreferencesSink extends DataFlow::Node {
1818
}
1919

2020
/**
21-
* A sanitizer for cleartext preferences storage vulnerabilities.
21+
* A barrier for cleartext preferences storage vulnerabilities.
2222
*/
23-
abstract class CleartextStoragePreferencesSanitizer extends DataFlow::Node { }
23+
abstract class CleartextStoragePreferencesBarrier extends DataFlow::Node { }
2424

2525
/**
2626
* A unit class for adding additional taint steps.
@@ -72,11 +72,11 @@ private class NSUserDefaultsControllerStore extends CleartextStoragePreferencesS
7272
}
7373

7474
/**
75-
* An encryption sanitizer for cleartext preferences storage vulnerabilities.
75+
* An encryption barrier for cleartext preferences storage vulnerabilities.
7676
*/
77-
private class CleartextStoragePreferencesEncryptionSanitizer extends CleartextStoragePreferencesSanitizer
77+
private class CleartextStoragePreferencesEncryptionBarrier extends CleartextStoragePreferencesBarrier
7878
{
79-
CleartextStoragePreferencesEncryptionSanitizer() { this.asExpr() instanceof EncryptedExpr }
79+
CleartextStoragePreferencesEncryptionBarrier() { this.asExpr() instanceof EncryptedExpr }
8080
}
8181

8282
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ module CleartextStoragePreferencesConfig implements DataFlow::ConfigSig {
1818

1919
predicate isSink(DataFlow::Node node) { node instanceof CleartextStoragePreferencesSink }
2020

21-
predicate isBarrier(DataFlow::Node sanitizer) {
22-
sanitizer instanceof CleartextStoragePreferencesSanitizer
21+
predicate isBarrier(DataFlow::Node barrier) {
22+
barrier instanceof CleartextStoragePreferencesBarrier
2323
}
2424

2525
predicate isAdditionalFlowStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) {

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import codeql.swift.dataflow.ExternalFlow
1515
abstract class CleartextTransmissionSink extends DataFlow::Node { }
1616

1717
/**
18-
* A sanitizer for cleartext transmission vulnerabilities.
18+
* A barrier for cleartext transmission vulnerabilities.
1919
*/
20-
abstract class CleartextTransmissionSanitizer extends DataFlow::Node { }
20+
abstract class CleartextTransmissionBarrier extends DataFlow::Node { }
2121

2222
/**
2323
* A unit class for adding additional taint steps.
@@ -81,10 +81,10 @@ private class AlamofireTransmittedSink extends CleartextTransmissionSink {
8181
}
8282

8383
/**
84-
* An encryption sanitizer for cleartext transmission vulnerabilities.
84+
* An encryption barrier for cleartext transmission vulnerabilities.
8585
*/
86-
private class CleartextTransmissionEncryptionSanitizer extends CleartextTransmissionSanitizer {
87-
CleartextTransmissionEncryptionSanitizer() { this.asExpr() instanceof EncryptedExpr }
86+
private class CleartextTransmissionEncryptionBarrier extends CleartextTransmissionBarrier {
87+
CleartextTransmissionEncryptionBarrier() { this.asExpr() instanceof EncryptedExpr }
8888
}
8989

9090
/**

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ module CleartextTransmissionConfig implements DataFlow::ConfigSig {
1818

1919
predicate isSink(DataFlow::Node node) { node instanceof CleartextTransmissionSink }
2020

21-
predicate isBarrier(DataFlow::Node sanitizer) {
22-
sanitizer instanceof CleartextTransmissionSanitizer
23-
}
21+
predicate isBarrier(DataFlow::Node barrier) { barrier instanceof CleartextTransmissionBarrier }
2422

2523
predicate isAdditionalFlowStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) {
2624
any(CleartextTransmissionAdditionalTaintStep s).step(nodeFrom, nodeTo)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import codeql.swift.dataflow.ExternalFlow
1414
abstract class ConstantPasswordSink extends DataFlow::Node { }
1515

1616
/**
17-
* A sanitizer for constant password vulnerabilities.
17+
* A barrier for constant password vulnerabilities.
1818
*/
19-
abstract class ConstantPasswordSanitizer extends DataFlow::Node { }
19+
abstract class ConstantPasswordBarrier extends DataFlow::Node { }
2020

2121
/**
2222
* A unit class for adding additional taint steps.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module ConstantPasswordConfig implements DataFlow::ConfigSig {
2828

2929
predicate isSink(DataFlow::Node node) { node instanceof ConstantPasswordSink }
3030

31-
predicate isBarrier(DataFlow::Node node) { node instanceof ConstantPasswordSanitizer }
31+
predicate isBarrier(DataFlow::Node node) { node instanceof ConstantPasswordBarrier }
3232

3333
predicate isAdditionalFlowStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) {
3434
any(ConstantPasswordAdditionalTaintStep s).step(nodeFrom, nodeTo)

0 commit comments

Comments
 (0)