Rust: More suggestions from review.

This commit is contained in:
Geoffrey White
2025-01-13 10:36:46 +00:00
parent 722b7bb55b
commit 676141bbb9
3 changed files with 13 additions and 14 deletions

View File

@@ -61,12 +61,12 @@ module NormalHashFunction {
*/
class SensitiveDataAsSource extends Source instanceof SensitiveData {
SensitiveDataAsSource() {
not this.(SensitiveData).getClassification() = SensitiveDataClassification::password() and // (covered in ComputationallyExpensiveHashFunction)
not this.(SensitiveData).getClassification() = SensitiveDataClassification::id() // (not accurate enough)
not SensitiveData.super.getClassification() = SensitiveDataClassification::password() and // (covered in ComputationallyExpensiveHashFunction)
not SensitiveData.super.getClassification() = SensitiveDataClassification::id() // (not accurate enough)
}
override SensitiveDataClassification getClassification() {
result = this.(SensitiveData).getClassification()
result = SensitiveData.super.getClassification()
}
}
@@ -138,11 +138,11 @@ module ComputationallyExpensiveHashFunction {
*/
class PasswordAsSource extends Source instanceof SensitiveData {
PasswordAsSource() {
this.(SensitiveData).getClassification() = SensitiveDataClassification::password()
SensitiveData.super.getClassification() = SensitiveDataClassification::password()
}
override SensitiveDataClassification getClassification() {
result = this.(SensitiveData).getClassification()
result = SensitiveData.super.getClassification()
}
}

View File

@@ -95,7 +95,6 @@
and
<a href="https://cheatsheetseries.owasp.org/cheatsheets/Transport_Layer_Security_Cheat_Sheet.html">
Transport Layer Security Cheat Sheet
</a>.
</li>
<li>

View File

@@ -43,7 +43,7 @@ module NormalHashFunctionFlow {
}
}
module Flow = TaintTracking::Global<Config>;
import TaintTracking::Global<Config>
}
/**
@@ -74,7 +74,7 @@ module ComputationallyExpensiveHashFunctionFlow {
}
}
module Flow = TaintTracking::Global<Config>;
import TaintTracking::Global<Config>
}
/**
@@ -83,10 +83,10 @@ module ComputationallyExpensiveHashFunctionFlow {
* merged to generate a combined path graph.
*/
module WeakSensitiveDataHashingFlow =
DataFlow::MergePathGraph<NormalHashFunctionFlow::Flow::PathNode,
ComputationallyExpensiveHashFunctionFlow::Flow::PathNode,
NormalHashFunctionFlow::Flow::PathGraph,
ComputationallyExpensiveHashFunctionFlow::Flow::PathGraph>;
DataFlow::MergePathGraph<NormalHashFunctionFlow::PathNode,
ComputationallyExpensiveHashFunctionFlow::PathNode,
NormalHashFunctionFlow::PathGraph,
ComputationallyExpensiveHashFunctionFlow::PathGraph>;
import WeakSensitiveDataHashingFlow::PathGraph
@@ -94,12 +94,12 @@ from
WeakSensitiveDataHashingFlow::PathNode source, WeakSensitiveDataHashingFlow::PathNode sink,
string ending, string algorithmName, string classification
where
NormalHashFunctionFlow::Flow::flowPath(source.asPathNode1(), sink.asPathNode1()) and
NormalHashFunctionFlow::flowPath(source.asPathNode1(), sink.asPathNode1()) and
algorithmName = sink.getNode().(NormalHashFunction::Sink).getAlgorithmName() and
classification = source.getNode().(NormalHashFunction::Source).getClassification() and
ending = "."
or
ComputationallyExpensiveHashFunctionFlow::Flow::flowPath(source.asPathNode2(), sink.asPathNode2()) and
ComputationallyExpensiveHashFunctionFlow::flowPath(source.asPathNode2(), sink.asPathNode2()) and
algorithmName = sink.getNode().(ComputationallyExpensiveHashFunction::Sink).getAlgorithmName() and
classification =
source.getNode().(ComputationallyExpensiveHashFunction::Source).getClassification() and