Skip to content

Commit 42e20c1

Browse files
authored
Merge pull request #59 from doublegate/copilot/sub-pr-57
fix(security): resolve cleartext logging alert and fuzz workspace error
2 parents 3d0daf2 + fa32c28 commit 42e20c1

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

crates/wraith-cli/src/main.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -707,16 +707,20 @@ async fn receive_files(
707707
node.start().await?;
708708

709709
let listen_addr = node.listen_addr().await?;
710+
711+
// Extract count before logging to avoid cleartext logging of sensitive trusted_peer_ids variable
712+
let trusted_peer_count = trusted_peer_ids.len();
713+
710714
println!("WRAITH Receive Mode");
711715
println!("Version: {}", env!("CARGO_PKG_VERSION"));
712716
println!();
713717
println!("Node ID: {}", hex::encode(node.node_id()));
714718
println!("Listening on: {}", listen_addr);
715719
println!("Output directory: {}", output.display());
716720
println!("Auto-accept: {}", auto_accept);
717-
if !trusted_peer_ids.is_empty() {
718-
// Only log count, not actual peer IDs to avoid cleartext logging of trusted peers
719-
println!("Trusted peers: {} configured", trusted_peer_ids.len());
721+
if trusted_peer_count > 0 {
722+
// Log only the count, not actual peer IDs to avoid cleartext logging
723+
println!("Trusted peers: {} configured", trusted_peer_count);
720724
}
721725
println!();
722726
println!("Ready to receive files. Press Ctrl+C to stop");

fuzz/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ rust-version = "1.88"
99
[package.metadata]
1010
cargo-fuzz = true
1111

12+
# Empty workspace table indicates this package is not part of the parent workspace
13+
[workspace]
14+
1215
[dependencies]
1316
libfuzzer-sys = "0.4"
1417
arbitrary = { version = "1.3", features = ["derive"] }

0 commit comments

Comments
 (0)