Skip to content

Commit 1af6b37

Browse files
committed
Rust: Add models for Warp
1 parent bfe9341 commit 1af6b37

File tree

3 files changed

+53
-3
lines changed

3 files changed

+53
-3
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/rust-all
4+
extensible: sourceModel
5+
data:
6+
- ["<_ as warp::filter::Filter>::then", "Argument[0].Parameter[0]", "remote", "manual"]
7+
- ["<_ as warp::filter::Filter>::then", "Argument[0].Parameter[1]", "remote", "manual"]
8+
- ["<_ as warp::filter::Filter>::then", "Argument[0].Parameter[2]", "remote", "manual"]
9+
- ["<_ as warp::filter::Filter>::then", "Argument[0].Parameter[3]", "remote", "manual"]
10+
- ["<_ as warp::filter::Filter>::then", "Argument[0].Parameter[4]", "remote", "manual"]
11+
- ["<_ as warp::filter::Filter>::map", "Argument[0].Parameter[0]", "remote", "manual"]
12+
- ["<_ as warp::filter::Filter>::map", "Argument[0].Parameter[1]", "remote", "manual"]
13+
- ["<_ as warp::filter::Filter>::map", "Argument[0].Parameter[2]", "remote", "manual"]
14+
- ["<_ as warp::filter::Filter>::map", "Argument[0].Parameter[3]", "remote", "manual"]
15+
- ["<_ as warp::filter::Filter>::map", "Argument[0].Parameter[4]", "remote", "manual"]
16+
- ["<_ as warp::filter::Filter>::and_then", "Argument[0].Parameter[0]", "remote", "manual"]
17+
- ["<_ as warp::filter::Filter>::and_then", "Argument[0].Parameter[1]", "remote", "manual"]
18+
- ["<_ as warp::filter::Filter>::and_then", "Argument[0].Parameter[2]", "remote", "manual"]
19+
- ["<_ as warp::filter::Filter>::and_then", "Argument[0].Parameter[3]", "remote", "manual"]
20+
- ["<_ as warp::filter::Filter>::and_then", "Argument[0].Parameter[4]", "remote", "manual"]

rust/ql/test/library-tests/dataflow/sources/TaintSources.expected

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,33 @@
100100
| web_frameworks.rs:58:14:58:15 | ms | Flow source 'RemoteSource' of type remote (DEFAULT). |
101101
| web_frameworks.rs:68:15:68:15 | a | Flow source 'RemoteSource' of type remote (DEFAULT). |
102102
| web_frameworks.rs:68:15:68:15 | a | Flow source 'RemoteSource' of type remote (DEFAULT). |
103+
| web_frameworks.rs:242:33:242:35 | map | Flow source 'RemoteSource' of type remote (DEFAULT). |
104+
| web_frameworks.rs:242:33:242:35 | map | Flow source 'RemoteSource' of type remote (DEFAULT). |
105+
| web_frameworks.rs:242:33:242:35 | map | Flow source 'RemoteSource' of type remote (DEFAULT). |
106+
| web_frameworks.rs:242:33:242:35 | map | Flow source 'RemoteSource' of type remote (DEFAULT). |
107+
| web_frameworks.rs:242:33:242:35 | map | Flow source 'RemoteSource' of type remote (DEFAULT). |
108+
| web_frameworks.rs:242:33:242:35 | map | Flow source 'RemoteSource' of type remote (DEFAULT). |
109+
| web_frameworks.rs:242:33:242:35 | map | Flow source 'RemoteSource' of type remote (DEFAULT). |
110+
| web_frameworks.rs:242:33:242:35 | map | Flow source 'RemoteSource' of type remote (DEFAULT). |
111+
| web_frameworks.rs:242:33:242:35 | map | Flow source 'RemoteSource' of type remote (DEFAULT). |
112+
| web_frameworks.rs:242:33:242:35 | map | Flow source 'RemoteSource' of type remote (DEFAULT). |
113+
| web_frameworks.rs:250:46:250:49 | then | Flow source 'RemoteSource' of type remote (DEFAULT). |
114+
| web_frameworks.rs:250:46:250:49 | then | Flow source 'RemoteSource' of type remote (DEFAULT). |
115+
| web_frameworks.rs:250:46:250:49 | then | Flow source 'RemoteSource' of type remote (DEFAULT). |
116+
| web_frameworks.rs:250:46:250:49 | then | Flow source 'RemoteSource' of type remote (DEFAULT). |
117+
| web_frameworks.rs:250:46:250:49 | then | Flow source 'RemoteSource' of type remote (DEFAULT). |
118+
| web_frameworks.rs:250:46:250:49 | then | Flow source 'RemoteSource' of type remote (DEFAULT). |
119+
| web_frameworks.rs:250:46:250:49 | then | Flow source 'RemoteSource' of type remote (DEFAULT). |
120+
| web_frameworks.rs:250:46:250:49 | then | Flow source 'RemoteSource' of type remote (DEFAULT). |
121+
| web_frameworks.rs:250:46:250:49 | then | Flow source 'RemoteSource' of type remote (DEFAULT). |
122+
| web_frameworks.rs:250:46:250:49 | then | Flow source 'RemoteSource' of type remote (DEFAULT). |
123+
| web_frameworks.rs:259:50:259:57 | and_then | Flow source 'RemoteSource' of type remote (DEFAULT). |
124+
| web_frameworks.rs:259:50:259:57 | and_then | Flow source 'RemoteSource' of type remote (DEFAULT). |
125+
| web_frameworks.rs:259:50:259:57 | and_then | Flow source 'RemoteSource' of type remote (DEFAULT). |
126+
| web_frameworks.rs:259:50:259:57 | and_then | Flow source 'RemoteSource' of type remote (DEFAULT). |
127+
| web_frameworks.rs:259:50:259:57 | and_then | Flow source 'RemoteSource' of type remote (DEFAULT). |
128+
| web_frameworks.rs:259:50:259:57 | and_then | Flow source 'RemoteSource' of type remote (DEFAULT). |
129+
| web_frameworks.rs:259:50:259:57 | and_then | Flow source 'RemoteSource' of type remote (DEFAULT). |
130+
| web_frameworks.rs:259:50:259:57 | and_then | Flow source 'RemoteSource' of type remote (DEFAULT). |
131+
| web_frameworks.rs:259:50:259:57 | and_then | Flow source 'RemoteSource' of type remote (DEFAULT). |
132+
| web_frameworks.rs:259:50:259:57 | and_then | Flow source 'RemoteSource' of type remote (DEFAULT). |

rust/ql/test/library-tests/dataflow/sources/web_frameworks.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,15 +239,15 @@ mod warp_test {
239239
async fn test_warp() {
240240
// A route with parameter and `map`
241241
let map_route =
242-
warp::path::param().map(|a: String| // $ MISSING: Alert[rust/summary/taint-sources]
242+
warp::path::param().map(|a: String| // $ Alert[rust/summary/taint-sources]
243243
{
244244
sink(a); // $ MISSING: hasTaintFlow
245245

246246
"".to_string()
247247
});
248248

249249
// A route with parameter and `then`
250-
let then_route = warp::path::param().then( // $ MISSING: Alert[rust/summary/taint-sources]
250+
let then_route = warp::path::param().then( // $ Alert[rust/summary/taint-sources]
251251
|a: String| async move {
252252
sink(a); // $ MISSING: hasTaintFlow
253253

@@ -256,7 +256,7 @@ mod warp_test {
256256
);
257257

258258
// A route with parameter and `and_then`
259-
let and_then_route = warp::path::param().and_then( // $ MISSING: Alert[rust/summary/taint-sources]
259+
let and_then_route = warp::path::param().and_then( // $ Alert[rust/summary/taint-sources]
260260
| id: u64 |
261261
async move {
262262
if id != 0 {

0 commit comments

Comments
 (0)