Skip to content

Commit 676141b

Browse files
committed
Rust: More suggestions from review.
1 parent 722b7bb commit 676141b

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

rust/ql/lib/codeql/rust/security/WeakSensitiveDataHashingExtensions.qll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ module NormalHashFunction {
6161
*/
6262
class SensitiveDataAsSource extends Source instanceof SensitiveData {
6363
SensitiveDataAsSource() {
64-
not this.(SensitiveData).getClassification() = SensitiveDataClassification::password() and // (covered in ComputationallyExpensiveHashFunction)
65-
not this.(SensitiveData).getClassification() = SensitiveDataClassification::id() // (not accurate enough)
64+
not SensitiveData.super.getClassification() = SensitiveDataClassification::password() and // (covered in ComputationallyExpensiveHashFunction)
65+
not SensitiveData.super.getClassification() = SensitiveDataClassification::id() // (not accurate enough)
6666
}
6767

6868
override SensitiveDataClassification getClassification() {
69-
result = this.(SensitiveData).getClassification()
69+
result = SensitiveData.super.getClassification()
7070
}
7171
}
7272

@@ -138,11 +138,11 @@ module ComputationallyExpensiveHashFunction {
138138
*/
139139
class PasswordAsSource extends Source instanceof SensitiveData {
140140
PasswordAsSource() {
141-
this.(SensitiveData).getClassification() = SensitiveDataClassification::password()
141+
SensitiveData.super.getClassification() = SensitiveDataClassification::password()
142142
}
143143

144144
override SensitiveDataClassification getClassification() {
145-
result = this.(SensitiveData).getClassification()
145+
result = SensitiveData.super.getClassification()
146146
}
147147
}
148148

rust/ql/src/queries/security/CWE-328/WeakSensitiveDataHashing.qhelp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@
9595
and
9696
<a href="https://cheatsheetseries.owasp.org/cheatsheets/Transport_Layer_Security_Cheat_Sheet.html">
9797
Transport Layer Security Cheat Sheet
98-
9998
</a>.
10099
</li>
101100
<li>

rust/ql/src/queries/security/CWE-328/WeakSensitiveDataHashing.ql

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module NormalHashFunctionFlow {
4343
}
4444
}
4545

46-
module Flow = TaintTracking::Global<Config>;
46+
import TaintTracking::Global<Config>
4747
}
4848

4949
/**
@@ -74,7 +74,7 @@ module ComputationallyExpensiveHashFunctionFlow {
7474
}
7575
}
7676

77-
module Flow = TaintTracking::Global<Config>;
77+
import TaintTracking::Global<Config>
7878
}
7979

8080
/**
@@ -83,23 +83,23 @@ module ComputationallyExpensiveHashFunctionFlow {
8383
* merged to generate a combined path graph.
8484
*/
8585
module WeakSensitiveDataHashingFlow =
86-
DataFlow::MergePathGraph<NormalHashFunctionFlow::Flow::PathNode,
87-
ComputationallyExpensiveHashFunctionFlow::Flow::PathNode,
88-
NormalHashFunctionFlow::Flow::PathGraph,
89-
ComputationallyExpensiveHashFunctionFlow::Flow::PathGraph>;
86+
DataFlow::MergePathGraph<NormalHashFunctionFlow::PathNode,
87+
ComputationallyExpensiveHashFunctionFlow::PathNode,
88+
NormalHashFunctionFlow::PathGraph,
89+
ComputationallyExpensiveHashFunctionFlow::PathGraph>;
9090

9191
import WeakSensitiveDataHashingFlow::PathGraph
9292

9393
from
9494
WeakSensitiveDataHashingFlow::PathNode source, WeakSensitiveDataHashingFlow::PathNode sink,
9595
string ending, string algorithmName, string classification
9696
where
97-
NormalHashFunctionFlow::Flow::flowPath(source.asPathNode1(), sink.asPathNode1()) and
97+
NormalHashFunctionFlow::flowPath(source.asPathNode1(), sink.asPathNode1()) and
9898
algorithmName = sink.getNode().(NormalHashFunction::Sink).getAlgorithmName() and
9999
classification = source.getNode().(NormalHashFunction::Source).getClassification() and
100100
ending = "."
101101
or
102-
ComputationallyExpensiveHashFunctionFlow::Flow::flowPath(source.asPathNode2(), sink.asPathNode2()) and
102+
ComputationallyExpensiveHashFunctionFlow::flowPath(source.asPathNode2(), sink.asPathNode2()) and
103103
algorithmName = sink.getNode().(ComputationallyExpensiveHashFunction::Sink).getAlgorithmName() and
104104
classification =
105105
source.getNode().(ComputationallyExpensiveHashFunction::Source).getClassification() and

0 commit comments

Comments
 (0)