Skip to content

Commit ff53d42

Browse files
committed
Rust: Model some sources in hyper.
1 parent d64d955 commit ff53d42

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/rust-all
4+
extensible: sourceModel
5+
data:
6+
- ["repo:https://github.com/hyperium/hyper:hyper", "<crate::client::conn::http1::SendRequest>::send_request", "ReturnValue", "remote", "manual"]
7+
- ["repo:https://github.com/hyperium/hyper:hyper", "<crate::client::conn::http2::SendRequest>::send_request", "ReturnValue", "remote", "manual"]
8+
- ["repo:https://github.com/hyperium/hyper:hyper", "<crate::client::conn::http1::SendRequest>::try_send_request", "ReturnValue", "remote", "manual"]
9+
- ["repo:https://github.com/hyperium/hyper:hyper", "<crate::client::conn::http2::SendRequest>::try_send_request", "ReturnValue", "remote", "manual"]
10+
- ["repo:https://github.com/hyperium/hyper:hyper", "<crate::client::Client>::get", "ReturnValue", "remote", "manual"]
11+
- ["repo:https://github.com/hyperium/hyper:hyper", "<crate::client::Client>::request", "ReturnValue", "remote", "manual"]
12+
- ["repo:https://github.com/hyperium/hyper-util:hyper-util", "<crate::client::legacy::Client>::get", "ReturnValue", "remote", "manual"]
13+
- ["repo:https://github.com/hyperium/hyper-util:hyper-util", "<crate::client::legacy::Client>::request", "ReturnValue", "remote", "manual"]

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@
1919
| test.rs:72:26:72:37 | ...::get | Flow source 'RemoteSource' of type remote (DEFAULT). |
2020
| test.rs:75:26:75:37 | ...::get | Flow source 'RemoteSource' of type remote (DEFAULT). |
2121
| test.rs:78:24:78:35 | ...::get | Flow source 'RemoteSource' of type remote (DEFAULT). |
22+
| test.rs:108:31:108:42 | send_request | Flow source 'RemoteSource' of type remote (DEFAULT). |
2223
| test.rs:193:16:193:29 | ...::args | Flow source 'CommandLineArgs' of type commandargs. |

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ async fn test_hyper_http(case: i64) -> Result<(), Box<dyn std::error::Error>> {
105105
// make the request
106106
println!("sending request...");
107107
let request = http::Request::builder().uri(url).body(String::from(""))?;
108-
let mut response = sender.send_request(request).await?; // $ MISSING: Alert[rust/summary/taint-sources]
108+
let mut response = sender.send_request(request).await?; // $ Alert[rust/summary/taint-sources]
109109
sink(&response); // $ MISSING: hasTaintFlow
110110

111111
if !response.status().is_success() {

0 commit comments

Comments
 (0)