Skip to content

Commit 217508e

Browse files
committed
Merge branch 'main' into gen1
2 parents 5105976 + 1936aba commit 217508e

File tree

7 files changed

+793
-55
lines changed

7 files changed

+793
-55
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: majorAnalysis
3+
---
4+
* Added basic models for the `actix-web` web framework.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/rust-all
4+
extensible: sourceModel
5+
data:
6+
- ["<actix_web::route::Route>::to", "Argument[0].Parameter[0..7]", "remote", "manual"]
7+
# Actix attributes such as `get` expand to this `to` call on the handler.
8+
- ["<actix_web::resource::Resource>::to", "Argument[0].Parameter[0..7]", "remote", "manual"]
9+
- addsTo:
10+
pack: codeql/rust-all
11+
extensible: summaryModel
12+
data:
13+
- ["<actix_web::types::path::Path>::into_inner", "Argument[self]", "ReturnValue", "taint", "manual"]
14+
- ["<actix_web::types::path::Path>::into_inner", "Argument[self]", "ReturnValue.Field[0]", "taint", "manual"]
15+
- ["<actix_web::types::path::Path>::into_inner", "Argument[self]", "ReturnValue.Field[1]", "taint", "manual"]
16+
- ["<actix_web::types::path::Path>::into_inner", "Argument[self]", "ReturnValue.Field[2]", "taint", "manual"]
17+
- ["<actix_web::types::path::Path>::into_inner", "Argument[self]", "ReturnValue.Field[3]", "taint", "manual"]
18+
- ["<actix_web::types::path::Path>::into_inner", "Argument[self]", "ReturnValue.Field[4]", "taint", "manual"]

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

Lines changed: 725 additions & 41 deletions
Large diffs are not rendered by default.

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,38 @@
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:127:5:127:20 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
104+
| web_frameworks.rs:127:5:127:20 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
105+
| web_frameworks.rs:127:5:127:20 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
106+
| web_frameworks.rs:127:5:127:20 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
107+
| web_frameworks.rs:127:5:127:20 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
108+
| web_frameworks.rs:127:5:127:20 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
109+
| web_frameworks.rs:127:5:127:20 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
110+
| web_frameworks.rs:127:5:127:20 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
111+
| web_frameworks.rs:139:41:139:42 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
112+
| web_frameworks.rs:139:41:139:42 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
113+
| web_frameworks.rs:139:41:139:42 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
114+
| web_frameworks.rs:139:41:139:42 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
115+
| web_frameworks.rs:139:41:139:42 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
116+
| web_frameworks.rs:139:41:139:42 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
117+
| web_frameworks.rs:139:41:139:42 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
118+
| web_frameworks.rs:139:41:139:42 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
119+
| web_frameworks.rs:140:45:140:46 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
120+
| web_frameworks.rs:140:45:140:46 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
121+
| web_frameworks.rs:140:45:140:46 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
122+
| web_frameworks.rs:140:45:140:46 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
123+
| web_frameworks.rs:140:45:140:46 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
124+
| web_frameworks.rs:140:45:140:46 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
125+
| web_frameworks.rs:140:45:140:46 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
126+
| web_frameworks.rs:140:45:140:46 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
127+
| web_frameworks.rs:141:41:141:42 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
128+
| web_frameworks.rs:141:41:141:42 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
129+
| web_frameworks.rs:141:41:141:42 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
130+
| web_frameworks.rs:141:41:141:42 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
131+
| web_frameworks.rs:141:41:141:42 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
132+
| web_frameworks.rs:141:41:141:42 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
133+
| web_frameworks.rs:141:41:141:42 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
134+
| web_frameworks.rs:141:41:141:42 | to | Flow source 'RemoteSource' of type remote (DEFAULT). |
103135
| web_frameworks.rs:242:33:242:35 | map | Flow source 'RemoteSource' of type remote (DEFAULT). |
104136
| web_frameworks.rs:242:33:242:35 | map | Flow source 'RemoteSource' of type remote (DEFAULT). |
105137
| web_frameworks.rs:242:33:242:35 | map | Flow source 'RemoteSource' of type remote (DEFAULT). |

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -95,50 +95,50 @@ mod actix_test {
9595
use actix_web::{get, web, App};
9696

9797
async fn my_actix_handler_1(
98-
path: web::Path<String>, // $ MISSING: Alert[rust/summary/taint-sources]
98+
path: web::Path<String>,
9999
) -> String {
100100
let a = path.into_inner();
101-
sink(a.as_str()); // $ MISSING: hasTaintFlow
102-
sink(a.as_bytes()); // $ MISSING: hasTaintFlow
103-
sink(a); // $ MISSING: hasTaintFlow
101+
sink(a.as_str()); // $ hasTaintFlow=my_actix_handler_1
102+
sink(a.as_bytes()); // $ hasTaintFlow=my_actix_handler_1
103+
sink(a); // $ hasTaintFlow=my_actix_handler_1
104104

105105
"".to_string()
106106
}
107107

108108
async fn my_actix_handler_2(
109-
path: web::Path<(String, String)>, // $ MISSING: Alert[rust/summary/taint-sources]
109+
path: web::Path<(String, String)>,
110110
) -> String {
111111
let (a, b) = path.into_inner();
112112

113-
sink(a); // $ MISSING: hasTaintFlow
114-
sink(b); // $ MISSING: hasTaintFlow
113+
sink(a); // $ hasTaintFlow=my_actix_handler_2
114+
sink(b); // $ hasTaintFlow=my_actix_handler_2
115115

116116
"".to_string()
117117
}
118118

119119
async fn my_actix_handler_3(
120-
web::Query(a): web::Query<String>, // $ MISSING: Alert[rust/summary/taint-sources]
120+
web::Query(a): web::Query<String>,
121121
) -> String {
122122
sink(a); // $ MISSING: hasTaintFlow
123123

124124
"".to_string()
125125
}
126126

127-
#[get("/4/{a}")]
127+
#[get("/4/{a}")] // $ Alert[rust/summary/taint-sources]
128128
async fn my_actix_handler_4(
129-
path: web::Path<String>, // $ MISSING: Alert[rust/summary/taint-sources]
129+
path: web::Path<String>,
130130
) -> String {
131131
let a = path.into_inner();
132-
sink(a); // $ MISSING: hasTaintFlow
132+
sink(a); // $ hasTaintFlow=my_actix_handler_4
133133

134134
"".to_string()
135135
}
136136

137137
async fn test_actix() {
138138
let app = App::new()
139-
.route("/1/{a}", web::get().to(my_actix_handler_1))
140-
.route("/2/{a}/{b}", web::get().to(my_actix_handler_2))
141-
.route("/3/{a}", web::get().to(my_actix_handler_3))
139+
.route("/1/{a}", web::get().to(my_actix_handler_1)) // $ Alert[rust/summary/taint-sources]
140+
.route("/2/{a}/{b}", web::get().to(my_actix_handler_2)) // $ Alert[rust/summary/taint-sources]
141+
.route("/3/{a}", web::get().to(my_actix_handler_3)) // $ Alert[rust/summary/taint-sources]
142142
.service(my_actix_handler_4);
143143

144144
// ...

0 commit comments

Comments
 (0)