Skip to content

Commit 8145264

Browse files
committed
Rust: Add threat model sources as additional sources for the query.
1 parent 2da0814 commit 8145264

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

rust/ql/src/queries/security/CWE-295/DisabledCertificateCheck.ql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import rust
1515
import codeql.rust.dataflow.DataFlow
1616
import codeql.rust.security.DisabledCertificateCheckExtensions
17+
import codeql.rust.Concepts
1718

1819
/**
1920
* A taint configuration for disabled TLS certificate checks.
@@ -22,7 +23,11 @@ module DisabledCertificateCheckConfig implements DataFlow::ConfigSig {
2223
import DisabledCertificateCheckExtensions
2324

2425
predicate isSource(DataFlow::Node node) {
26+
// the constant `true`
2527
node.asExpr().getExpr().(BooleanLiteralExpr).getTextValue() = "true"
28+
or
29+
// a value controlled by a potential attacker
30+
node instanceof ActiveThreatModelSource
2631
}
2732

2833
predicate isSink(DataFlow::Node node) { node instanceof Sink }

0 commit comments

Comments
 (0)