Skip to content

Commit 0ac8b7c

Browse files
authored
Merge pull request #10128 from MathiasVP/add-cleartext-sanitizer
C++: Add a sanitizer to `cpp/cleartext-storage-buffer`
2 parents 25195bb + 831f143 commit 0ac8b7c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

cpp/ql/src/Security/CWE/CWE-311/CleartextBufferWrite.ql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ class ToBufferConfiguration extends TaintTracking::Configuration {
2626

2727
override predicate isSource(DataFlow::Node source) { source instanceof FlowSource }
2828

29+
override predicate isSanitizer(DataFlow::Node node) {
30+
node.asExpr().getUnspecifiedType() instanceof IntegralType
31+
}
32+
2933
override predicate isSink(DataFlow::Node sink) {
3034
exists(BufferWrite::BufferWrite w | w.getASource() = sink.asExpr())
3135
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* The "Cleartext storage of sensitive information in buffer" (`cpp/cleartext-storage-buffer`) query has been improved to produce fewer false positives.

0 commit comments

Comments
 (0)