Skip to content

Commit 03ba7ea

Browse files
committed
C++: Move the weird global property 'not sqlite_encryption_used()' from the sink definition to the source definition. The dataflow library starts tracking flow from the sources, so it's better to to rule out the entire database in the source definition than in the sink definition.
1 parent 7819a7d commit 03ba7ea

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

cpp/ql/src/Security/CWE/CWE-313/CleartextSqliteDatabase.ql

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,12 @@ predicate isSinkImpl(DataFlow::Node sink, SqliteFunctionCall c, Type t) {
102102
* A taint flow configuration for flow from a sensitive expression to a `SqliteFunctionCall` sink.
103103
*/
104104
module FromSensitiveConfiguration implements DataFlow::ConfigSig {
105-
predicate isSource(DataFlow::Node source) { isSourceImpl(source, _) }
106-
107-
predicate isSink(DataFlow::Node sink) {
108-
isSinkImpl(sink, _, _) and
109-
not sqlite_encryption_used()
105+
predicate isSource(DataFlow::Node source) {
106+
isSourceImpl(source, _) and not sqlite_encryption_used()
110107
}
111108

109+
predicate isSink(DataFlow::Node sink) { isSinkImpl(sink, _, _) }
110+
112111
predicate isBarrier(DataFlow::Node node) {
113112
node.asExpr().getUnspecifiedType() instanceof IntegralType
114113
}

0 commit comments

Comments
 (0)