Skip to content

Commit 661160a

Browse files
committed
C++: Update PrivateCleartextWrite with DataFlow::ConfigSig
1 parent a247a8b commit 661160a

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: deprecated
3+
---
4+
* The `WriteConfig` taint tracking configuration has been deprecated. Please use `WriteFlow`.

cpp/ql/lib/experimental/semmle/code/cpp/security/PrivateCleartextWrite.qll

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module PrivateCleartextWrite {
3636
}
3737
}
3838

39-
class WriteConfig extends TaintTracking::Configuration {
39+
deprecated class WriteConfig extends TaintTracking::Configuration {
4040
WriteConfig() { this = "Write configuration" }
4141

4242
override predicate isSource(DataFlow::Node source) { source instanceof Source }
@@ -46,6 +46,16 @@ module PrivateCleartextWrite {
4646
override predicate isSanitizer(DataFlow::Node node) { node instanceof Sanitizer }
4747
}
4848

49+
private module WriteConfig implements DataFlow::ConfigSig {
50+
predicate isSource(DataFlow::Node source) { source instanceof Source }
51+
52+
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
53+
54+
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
55+
}
56+
57+
module WriteFlow = TaintTracking::Make<WriteConfig>;
58+
4959
class PrivateDataSource extends Source {
5060
PrivateDataSource() { this.getExpr() instanceof PrivateDataExpr }
5161
}

cpp/ql/src/experimental/Security/CWE/CWE-359/PrivateCleartextWrite.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
import cpp
1414
import experimental.semmle.code.cpp.security.PrivateCleartextWrite
1515
import experimental.semmle.code.cpp.security.PrivateCleartextWrite::PrivateCleartextWrite
16-
import DataFlow::PathGraph
16+
import WriteFlow::PathGraph
1717

18-
from WriteConfig b, DataFlow::PathNode source, DataFlow::PathNode sink
19-
where b.hasFlowPath(source, sink)
18+
from WriteFlow::PathNode source, WriteFlow::PathNode sink
19+
where WriteFlow::hasFlowPath(source, sink)
2020
select sink.getNode(), source, sink,
2121
"This write into the external location '" + sink.getNode() +
2222
"' may contain unencrypted data from $@.", source, "this source of private data."

0 commit comments

Comments
 (0)