Skip to content

Commit d8e57bd

Browse files
committed
Rust: Exclude taint-read-steps for axum::extract::state::State
1 parent 22bfd1b commit d8e57bd

3 files changed

Lines changed: 7 additions & 8 deletions

File tree

rust/ql/lib/codeql/rust/frameworks/axum.model.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,9 @@ extensions:
2020
- ["<axum::routing::method_routing::MethodRouter>::patch", "Argument[0].Parameter[0..7]", "remote", "manual"]
2121
# on
2222
- ["axum::routing::method_routing::on", "Argument[1].Parameter[0..7]", "remote", "manual"]
23-
- ["<axum::routing::method_routing::MethodRouter>::on", "Argument[1].Parameter[0..7]", "remote", "manual"]
23+
- ["<axum::routing::method_routing::MethodRouter>::on", "Argument[1].Parameter[0..7]", "remote", "manual"]
24+
- addsTo:
25+
pack: codeql/rust-all
26+
extensible: excludeFieldTaintStep
27+
data:
28+
- ["axum::extract::state::State(0)"]

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,13 @@ edges
5959
| test.rs:180:32:180:69 | ...: Json::<...> | test.rs:182:14:182:20 | payload | provenance | |
6060
| test.rs:187:32:187:43 | ...: String | test.rs:188:14:188:17 | body | provenance | |
6161
| test.rs:193:32:193:43 | ...: String | test.rs:194:14:194:17 | body | provenance | |
62-
| test.rs:199:32:199:47 | ...: State::<...> | test.rs:200:14:200:20 | state.0 | provenance | |
6362
| test.rs:199:50:199:61 | ...: String | test.rs:201:14:201:17 | body | provenance | |
6463
| test.rs:208:34:208:50 | my_axum_handler_1 | test.rs:148:32:148:52 | ...: Path::<...> | provenance | Src:MaD:8 |
6564
| test.rs:209:39:209:55 | my_axum_handler_2 | test.rs:156:32:156:67 | ...: Path::<...> | provenance | Src:MaD:9 |
6665
| test.rs:210:33:210:49 | my_axum_handler_3 | test.rs:163:32:163:76 | ...: Query::<...> | provenance | Src:MaD:10 |
6766
| test.rs:213:65:213:81 | my_axum_handler_5 | test.rs:180:32:180:69 | ...: Json::<...> | provenance | Src:MaD:4 |
6867
| test.rs:215:33:215:49 | my_axum_handler_6 | test.rs:187:32:187:43 | ...: String | provenance | Src:MaD:8 |
6968
| test.rs:215:56:215:72 | my_axum_handler_7 | test.rs:193:32:193:43 | ...: String | provenance | Src:MaD:3 |
70-
| test.rs:216:33:216:49 | my_axum_handler_8 | test.rs:199:32:199:47 | ...: State::<...> | provenance | Src:MaD:8 |
7169
| test.rs:216:33:216:49 | my_axum_handler_8 | test.rs:199:50:199:61 | ...: String | provenance | Src:MaD:8 |
7270
| test.rs:231:37:236:9 | \|...\| ... | test.rs:231:38:231:46 | ...: String | provenance | Src:MaD:6 |
7371
| test.rs:231:38:231:46 | ...: String | test.rs:233:18:233:18 | a | provenance | |
@@ -139,9 +137,7 @@ nodes
139137
| test.rs:188:14:188:17 | body | semmle.label | body |
140138
| test.rs:193:32:193:43 | ...: String | semmle.label | ...: String |
141139
| test.rs:194:14:194:17 | body | semmle.label | body |
142-
| test.rs:199:32:199:47 | ...: State::<...> | semmle.label | ...: State::<...> |
143140
| test.rs:199:50:199:61 | ...: String | semmle.label | ...: String |
144-
| test.rs:200:14:200:20 | state.0 | semmle.label | state.0 |
145141
| test.rs:201:14:201:17 | body | semmle.label | body |
146142
| test.rs:208:34:208:50 | my_axum_handler_1 | semmle.label | my_axum_handler_1 |
147143
| test.rs:209:39:209:55 | my_axum_handler_2 | semmle.label | my_axum_handler_2 |
@@ -150,7 +146,6 @@ nodes
150146
| test.rs:215:33:215:49 | my_axum_handler_6 | semmle.label | my_axum_handler_6 |
151147
| test.rs:215:56:215:72 | my_axum_handler_7 | semmle.label | my_axum_handler_7 |
152148
| test.rs:216:33:216:49 | my_axum_handler_8 | semmle.label | my_axum_handler_8 |
153-
| test.rs:216:33:216:49 | my_axum_handler_8 | semmle.label | my_axum_handler_8 |
154149
| test.rs:231:37:236:9 | \|...\| ... | semmle.label | \|...\| ... |
155150
| test.rs:231:38:231:46 | ...: String | semmle.label | ...: String |
156151
| test.rs:233:18:233:18 | a | semmle.label | a |
@@ -193,7 +188,6 @@ testFailures
193188
| test.rs:182:14:182:20 | payload | test.rs:213:65:213:81 | my_axum_handler_5 | test.rs:182:14:182:20 | payload | $@ | test.rs:213:65:213:81 | my_axum_handler_5 | my_axum_handler_5 |
194189
| test.rs:188:14:188:17 | body | test.rs:215:33:215:49 | my_axum_handler_6 | test.rs:188:14:188:17 | body | $@ | test.rs:215:33:215:49 | my_axum_handler_6 | my_axum_handler_6 |
195190
| test.rs:194:14:194:17 | body | test.rs:215:56:215:72 | my_axum_handler_7 | test.rs:194:14:194:17 | body | $@ | test.rs:215:56:215:72 | my_axum_handler_7 | my_axum_handler_7 |
196-
| test.rs:200:14:200:20 | state.0 | test.rs:216:33:216:49 | my_axum_handler_8 | test.rs:200:14:200:20 | state.0 | $@ | test.rs:216:33:216:49 | my_axum_handler_8 | my_axum_handler_8 |
197191
| test.rs:201:14:201:17 | body | test.rs:216:33:216:49 | my_axum_handler_8 | test.rs:201:14:201:17 | body | $@ | test.rs:216:33:216:49 | my_axum_handler_8 | my_axum_handler_8 |
198192
| test.rs:233:18:233:18 | a | test.rs:231:37:236:9 | \|...\| ... | test.rs:233:18:233:18 | a | $@ | test.rs:231:37:236:9 | \|...\| ... | \|...\| ... |
199193
| test.rs:241:22:241:22 | a | test.rs:240:13:244:13 | \|...\| ... | test.rs:241:22:241:22 | a | $@ | test.rs:240:13:244:13 | \|...\| ... | \|...\| ... |

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ mod axum_test {
197197
}
198198

199199
async fn my_axum_handler_8(state: State<()>, body: String) -> &'static str {
200-
sink(state.0); // $ SPURIOUS: hasTaintFlow=my_axum_handler_8
200+
sink(state.0);
201201
sink(body); // $ hasTaintFlow=my_axum_handler_8
202202

203203
""

0 commit comments

Comments
 (0)