Skip to content

Commit b96552d

Browse files
committed
Rust: Exclude taint-read-steps for axum::extract::state::State
1 parent d5cd42c commit b96552d

3 files changed

Lines changed: 7 additions & 6 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 & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ edges
5555
| test.rs:213:65:213:81 | my_axum_handler_5 | test.rs:182:14:182:20 | payload | provenance | Src:MaD:4 |
5656
| test.rs:215:33:215:49 | my_axum_handler_6 | test.rs:188:14:188:17 | body | provenance | Src:MaD:8 |
5757
| test.rs:215:56:215:72 | my_axum_handler_7 | test.rs:194:14:194:17 | body | provenance | Src:MaD:3 |
58-
| test.rs:216:33:216:49 | my_axum_handler_8 | test.rs:200:14:200:20 | state.0 | provenance | Src:MaD:8 |
5958
| test.rs:216:33:216:49 | my_axum_handler_8 | test.rs:201:14:201:17 | body | provenance | Src:MaD:8 |
6059
| test.rs:231:37:236:9 | \|...\| ... | test.rs:233:18:233:18 | a | provenance | Src:MaD:6 |
6160
| test.rs:240:13:244:13 | \|...\| ... | test.rs:241:22:241:22 | a | provenance | Src:MaD:7 |
@@ -113,7 +112,6 @@ nodes
113112
| test.rs:182:14:182:20 | payload | semmle.label | payload |
114113
| test.rs:188:14:188:17 | body | semmle.label | body |
115114
| test.rs:194:14:194:17 | body | semmle.label | body |
116-
| test.rs:200:14:200:20 | state.0 | semmle.label | state.0 |
117115
| test.rs:201:14:201:17 | body | semmle.label | body |
118116
| test.rs:208:34:208:50 | my_axum_handler_1 | semmle.label | my_axum_handler_1 |
119117
| test.rs:209:39:209:55 | my_axum_handler_2 | semmle.label | my_axum_handler_2 |
@@ -122,7 +120,6 @@ nodes
122120
| test.rs:215:33:215:49 | my_axum_handler_6 | semmle.label | my_axum_handler_6 |
123121
| test.rs:215:56:215:72 | my_axum_handler_7 | semmle.label | my_axum_handler_7 |
124122
| test.rs:216:33:216:49 | my_axum_handler_8 | semmle.label | my_axum_handler_8 |
125-
| test.rs:216:33:216:49 | my_axum_handler_8 | semmle.label | my_axum_handler_8 |
126123
| test.rs:231:37:236:9 | \|...\| ... | semmle.label | \|...\| ... |
127124
| test.rs:233:18:233:18 | a | semmle.label | a |
128125
| test.rs:240:13:244:13 | \|...\| ... | semmle.label | \|...\| ... |
@@ -161,7 +158,6 @@ testFailures
161158
| 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 |
162159
| 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 |
163160
| 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 |
164-
| 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 |
165161
| 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 |
166162
| 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 | \|...\| ... | \|...\| ... |
167163
| 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)