From 1124355cdb3d834d99df27c7c691b3a2ee884609 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 9 Jul 2025 11:22:32 +0100 Subject: [PATCH 1/3] Rust: Add a test case for 'from_trusted_iterator' as sensitive data FP. --- rust/ql/test/library-tests/sensitivedata/test.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/rust/ql/test/library-tests/sensitivedata/test.rs b/rust/ql/test/library-tests/sensitivedata/test.rs index a34fbb1dda9e..3da550e2ad6d 100644 --- a/rust/ql/test/library-tests/sensitivedata/test.rs +++ b/rust/ql/test/library-tests/sensitivedata/test.rs @@ -345,3 +345,18 @@ fn test_private_info( sink(ContactDetails::FavouriteColor("blue".to_string())); } + +struct MyArray { + data: [i32; 10], +} + +impl MyArray { + fn from_trusted_iterator(iter: impl Iterator) -> Self { + MyArray { data: [0; 10] } + } +} + +fn test_iterator() { + let iter = std::iter::repeat(1).take(10); + sink(MyArray::from_trusted_iterator(iter)); // $ SPURIOUS: sensitive=secret +} From 22aa7f378a01388e605fe1a2c76506dcfb4a9190 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 9 Jul 2025 11:33:47 +0100 Subject: [PATCH 2/3] Rust: Expand the test cases around IDs as sensitive data. --- rust/ql/test/library-tests/sensitivedata/test.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rust/ql/test/library-tests/sensitivedata/test.rs b/rust/ql/test/library-tests/sensitivedata/test.rs index 3da550e2ad6d..ad13fee59f15 100644 --- a/rust/ql/test/library-tests/sensitivedata/test.rs +++ b/rust/ql/test/library-tests/sensitivedata/test.rs @@ -88,7 +88,7 @@ fn get_next_token() -> String { get_string() } fn test_credentials( account_key: &str, accnt_key: &str, license_key: &str, secret_key: &str, is_secret: bool, num_accounts: i64, - username: String, user_name: String, userid: i64, user_id: i64, my_user_id_64: i64, unique_id: i64, uid: i64, + username: String, user_name: String, userid: i64, user_id: i64, my_user_id_64: i64, id: i64, uid: i64, uuid: i64, guid: i64, unique_id: i64, sessionkey: &[u64; 4], session_key: &[u64; 4], hashkey: &[u64; 4], hash_key: &[u64; 4], sessionkeypath: &[u64; 4], account_key_path: &[u64; 4], ms: &MyStruct ) { @@ -119,8 +119,12 @@ fn test_credentials( sink(is_secret); sink(num_accounts); // $ SPURIOUS: sensitive=id - sink(unique_id); + sink(id); sink(uid); // $ SPURIOUS: sensitive=id + sink(uuid); // $ SPURIOUS: sensitive=id + sink(guid); + sink(unique_id); + sink(hashkey); sink(hash_key); sink(sessionkeypath); // $ SPURIOUS: sensitive=id From 3bb3fccfdb731de28cb4b5c56e272cee00b97f84 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 9 Jul 2025 12:02:19 +0100 Subject: [PATCH 3/3] Rust: Accept consistency check changes. --- .../PathResolutionConsistency.expected | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/rust/ql/test/library-tests/sensitivedata/CONSISTENCY/PathResolutionConsistency.expected b/rust/ql/test/library-tests/sensitivedata/CONSISTENCY/PathResolutionConsistency.expected index 8e9d2afecd0c..0533774588cc 100644 --- a/rust/ql/test/library-tests/sensitivedata/CONSISTENCY/PathResolutionConsistency.expected +++ b/rust/ql/test/library-tests/sensitivedata/CONSISTENCY/PathResolutionConsistency.expected @@ -5,23 +5,23 @@ multipleCallTargets | test.rs:73:7:73:36 | ... .as_str() | | test.rs:74:7:74:34 | ... .as_str() | | test.rs:75:7:75:27 | ... .as_str() | -| test.rs:254:7:254:36 | ... .as_str() | -| test.rs:256:7:256:33 | ... .as_str() | -| test.rs:257:7:257:36 | ... .as_str() | -| test.rs:258:7:258:26 | ... .as_str() | -| test.rs:262:7:262:28 | ... .as_str() | -| test.rs:263:7:263:37 | ... .as_str() | -| test.rs:264:7:264:36 | ... .as_str() | -| test.rs:267:7:267:32 | ... .as_str() | -| test.rs:277:7:277:34 | ... .as_str() | -| test.rs:280:7:280:36 | ... .as_str() | -| test.rs:284:7:284:39 | ... .as_str() | -| test.rs:291:7:291:53 | ... .as_str() | -| test.rs:292:7:292:45 | ... .as_str() | -| test.rs:294:7:294:39 | ... .as_str() | -| test.rs:295:7:295:34 | ... .as_str() | -| test.rs:296:7:296:42 | ... .as_str() | -| test.rs:298:7:298:48 | ... .as_str() | -| test.rs:299:7:299:35 | ... .as_str() | -| test.rs:300:7:300:35 | ... .as_str() | -| test.rs:339:7:339:39 | ... .as_str() | +| test.rs:258:7:258:36 | ... .as_str() | +| test.rs:260:7:260:33 | ... .as_str() | +| test.rs:261:7:261:36 | ... .as_str() | +| test.rs:262:7:262:26 | ... .as_str() | +| test.rs:266:7:266:28 | ... .as_str() | +| test.rs:267:7:267:37 | ... .as_str() | +| test.rs:268:7:268:36 | ... .as_str() | +| test.rs:271:7:271:32 | ... .as_str() | +| test.rs:281:7:281:34 | ... .as_str() | +| test.rs:284:7:284:36 | ... .as_str() | +| test.rs:288:7:288:39 | ... .as_str() | +| test.rs:295:7:295:53 | ... .as_str() | +| test.rs:296:7:296:45 | ... .as_str() | +| test.rs:298:7:298:39 | ... .as_str() | +| test.rs:299:7:299:34 | ... .as_str() | +| test.rs:300:7:300:42 | ... .as_str() | +| test.rs:302:7:302:48 | ... .as_str() | +| test.rs:303:7:303:35 | ... .as_str() | +| test.rs:304:7:304:35 | ... .as_str() | +| test.rs:343:7:343:39 | ... .as_str() | pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy