{"id":"DHI-cvqu-2sh3-wnzt-7rp7","aliases":[],"title":"The build script of `libz-sys` version <= 1.1.30 prints the full environment","originalDescription":"The build script of `libz-sys` version <= 1.1.30 prints the full environment of the build, including any secrets it contains, to its stdout when compiled with `cc@1.6.0` or later on a Unix host. This affects any build that depends on `libz-sys`. Cargo saves build script stdout under `target/`, so the values end up in anything that stores or shares the `target/` directory, such as CI caches. This is similar to the [Miri issue](https://blog.rust-lang.org/2026/09/21/github-actions-leaking-secrets-when-miri-output-is-cached/). ## Details To decide whether to link against a system zlib, the `libz-sys` build script compiles a small test program with a compiler command from `cc` and logs it with: ```rust println!(\"running {:?}\", cmd); ``` On Unix, `Debug` impl for `std::process::Command` prints every environment variable explicitly set on the command. Before `cc@1.6.0`, its `Tool::to_command()` set only a few compiler-specific variables. Starting with `cc@1.6.0` (released 2026-10-03), `Tool::to_command()` clears the environment and sets every variable explicitly. Cargo parses build script stdout for `cargo:` directives, and stores the full output in the build directory. It also prints it ","severity":{"cvss":null,"vector":null,"label":null},"exploitation":{"kev":null,"epss":null,"exploitDb":null},"affected":[],"references":[{"url":"https://scout.docker.com/v/DHI-cvqu-2sh3-wnzt-7rp7","type":"advisory"},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0418","type":"advisory"},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0418.html","type":"advisory"},{"url":"https://github.com/rust-lang/libz-sys/pull/280","type":"fix"}],"sources":[{"name":"osv","at":"2026-12-01T18:13:48.065Z","url":"https://osv.dev/vulnerability/DHI-cvqu-2sh3-wnzt-7rp7","license":"CC-BY 4.0","firstSeenAt":"2026-11-20T16:58:47.237Z"}],"firstSeenAt":"2026-11-20T16:58:47.237Z","publishedAt":"2026-11-20T01:49:34.000Z","modifiedAt":"2026-12-01T17:45:11.128Z"}