Skip to content

Commit 044d0a1

Browse files
committed
Rust: Include WeakSensitiveDataHashing sinks as well.
1 parent 4924a0f commit 044d0a1

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module NormalHashFunction {
4343
* data" vulnerabilities that applies to data that does not require computationally expensive
4444
* hashing. That is, a broken or weak hashing algorithm.
4545
*/
46-
abstract class Sink extends DataFlow::Node {
46+
abstract class Sink extends QuerySink::Range {
4747
/**
4848
* Gets the name of the weak hashing algorithm.
4949
*/
@@ -76,6 +76,8 @@ module NormalHashFunction {
7676
class WeakHashingOperationInputAsSink extends Sink {
7777
Cryptography::HashingAlgorithm algorithm;
7878

79+
override string getSinkType() { result = "WeakSensitiveDataHashing" }
80+
7981
WeakHashingOperationInputAsSink() {
8082
exists(Cryptography::CryptographicOperation operation |
8183
algorithm.isWeak() and
@@ -114,7 +116,9 @@ module ComputationallyExpensiveHashFunction {
114116
* hashing. That is, a broken or weak hashing algorithm or one that is not computationally
115117
* expensive enough for password hashing.
116118
*/
117-
abstract class Sink extends DataFlow::Node {
119+
abstract class Sink extends QuerySink::Range {
120+
override string getSinkType() { result = "WeakSensitiveDataHashing" }
121+
118122
/**
119123
* Gets the name of the weak hashing algorithm.
120124
*/

rust/ql/src/queries/summary/Stats.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ private import codeql.rust.controlflow.internal.CfgConsistency as CfgConsistency
1111
private import codeql.rust.dataflow.internal.DataFlowConsistency as DataFlowConsistency
1212
private import codeql.rust.Concepts
1313
// import all query extensions files, so that all extensions of `QuerySink` are found
14-
private import codeql.rust.security.SqlInjectionExtensions
1514
private import codeql.rust.security.CleartextLoggingExtensions
15+
private import codeql.rust.security.SqlInjectionExtensions
16+
private import codeql.rust.security.WeakSensitiveDataHashingExtensions
1617

1718
/**
1819
* Gets a count of the total number of lines of code in the database.

0 commit comments

Comments
 (0)