Skip to content

Commit 344fea2

Browse files
committed
Rust: Enable local threat models in tests and use active threat models for regex query
1 parent 179ea04 commit 344fea2

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

rust/ql/src/queries/security/CWE-730/RegexInjection.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ private import codeql.rust.security.regex.RegexInjectionExtensions
2121
* A taint configuration for detecting regular expression injection vulnerabilities.
2222
*/
2323
module RegexInjectionConfig implements DataFlow::ConfigSig {
24-
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelSource }
24+
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
2525

2626
predicate isSink(DataFlow::Node sink) { sink instanceof RegexInjectionSink }
2727

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/threat-models
4+
extensible: threatModelConfiguration
5+
data:
6+
- ["local", true, 0]

rust/ql/test/qlpack.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ dependencies:
66
extractor: rust
77
tests: .
88
warnOnImplicitThis: true
9+
dataExtensions:
10+
- default-threat-models.model.yml

0 commit comments

Comments
 (0)