{"id":"DHI-cvqu-2sh3-wnzt-7rp7","summary":"The build script of `libz-sys` version \u003c= 1.1.30 prints the full environment","details":"The build script of `libz-sys` version \u003c= 1.1.30 prints the full environment\nof the build, including any secrets it contains, to its stdout when compiled\nwith `cc@1.6.0` or later on a Unix host. This affects any build that depends on\n`libz-sys`. Cargo saves build script stdout under `target/`, so the values end\nup in anything that stores or shares the `target/` directory, such as CI caches.\n\nThis is similar to the [Miri issue](https://blog.rust-lang.org/2026/09/21/github-actions-leaking-secrets-when-miri-output-is-cached/).\n\n## Details\n\nTo decide whether to link against a system zlib, the `libz-sys` build script\ncompiles a small test program with a compiler command from `cc` and logs it\nwith:\n\n```rust\nprintln!(\"running {:?}\", cmd);\n```\n\nOn Unix, `Debug` impl for `std::process::Command` prints every environment\nvariable explicitly set on the command. Before `cc@1.6.0`, its\n`Tool::to_command()` set only a few compiler-specific variables. Starting with\n`cc@1.6.0` (released 2026-10-03), `Tool::to_command()` clears the environment\nand sets every variable explicitly.\n\nCargo parses build script stdout for `cargo:` directives, and stores the full\noutput in the build directory. It also prints it with `-vv`.\n\nThe probe runs for a default `libz-sys` build, including when pkg-config finds\nzlib, unless one of these applies:\n\n* the target is Windows, Android, Haiku or OpenHarmony\n* static linking is requested via the `static` feature or `LIBZ_SYS_STATIC=1`\n* the `zlib-ng` features are enabled without `stock-zlib`\n\n## Mitigations\n\nFixed in `libz-sys@1.1.31`, which no longer logs the probe command.\n\nIf you cannot upgrade, here are some workarounds:\n\n* Build with `LIBZ_SYS_STATIC=1` or the `static` feature, which skips the probe.\n* Pin `cc` to a release before 1.6.0 (`cargo update cc --precise \u003cversion\u003e`).\n\nNote that upgrading `libz-sys` does not remove values already written. If an\naffected build already ran with secrets in its environment, clear CI caches and\nstored artifacts containing its\n[target/build directory](https://doc.rust-lang.org/nightly/cargo/reference/build-cache.html#build-cache),\nand consider rotating those secrets.","modified":"2026-11-28T21:30:02.777064202Z","published":"2026-11-20T01:49:34Z","upstream":["GHSA-8p3x-q3q3-q3v5"],"references":[{"type":"ADVISORY","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":"FIX","url":"https://github.com/rust-lang/libz-sys/pull/280"}],"affected":[{"package":{"name":"static-web-server-2","ecosystem":"Docker Hardened Images:Alpine:3.23","purl":"pkg:apk/dhi/static-web-server-2"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.44.1-r0"}]}],"versions":["2.44.1-r0","2.44.2-r0","2.44.3-r0"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-cvqu-2sh3-wnzt-7rp7.json"}},{"package":{"name":"static-web-server-2","ecosystem":"Docker Hardened Images:Alpine:3.24","purl":"pkg:apk/dhi/static-web-server-2"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.44.1-r0"}]}],"versions":["2.44.1-r0","2.44.2-r0","2.44.3-r0"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-cvqu-2sh3-wnzt-7rp7.json"}},{"package":{"name":"static-web-server-2","ecosystem":"Docker Hardened Images:Debian:13","purl":"pkg:deb/dhi/static-web-server-2"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.44.1-0"}]}],"versions":["2.44.1-0","2.44.2-0","2.44.3-0","2.44.3-1","2.44.3-2","2.44.3-3","2.44.3-4","2.44.3-5","2.44.3-6"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-cvqu-2sh3-wnzt-7rp7.json"}},{"package":{"name":"teleport-18-dev","ecosystem":"Docker Hardened Images:Debian:13","purl":"pkg:deb/dhi/teleport-18-dev"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"18.11.1-2"}]}],"versions":["18.11.1-10","18.11.1-11","18.11.1-12","18.11.1-13","18.11.1-14","18.11.1-15","18.11.1-16","18.11.1-17","18.11.1-18","18.11.1-2","18.11.1-3","18.11.1-4","18.11.1-5","18.11.1-6","18.11.1-7","18.11.1-8","18.11.1-9","18.11.10-0","18.11.10-1","18.11.10-10","18.11.10-11","18.11.10-12","18.11.10-2","18.11.10-3","18.11.10-4","18.11.10-5","18.11.10-6","18.11.10-7","18.11.10-8","18.11.10-9"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-cvqu-2sh3-wnzt-7rp7.json"}},{"package":{"name":"teleport-18-fips-dev","ecosystem":"Docker Hardened Images:Debian:13","purl":"pkg:deb/dhi/teleport-18-fips-dev"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"18.11.1-2"}]}],"versions":["18.11.1-10","18.11.1-11","18.11.1-12","18.11.1-13","18.11.1-14","18.11.1-15","18.11.1-16","18.11.1-17","18.11.1-18","18.11.1-2","18.11.1-3","18.11.1-4","18.11.1-5","18.11.1-6","18.11.1-7","18.11.1-8","18.11.1-9","18.11.10-0","18.11.10-1","18.11.10-10","18.11.10-11","18.11.10-12","18.11.10-2","18.11.10-3","18.11.10-4","18.11.10-5","18.11.10-6","18.11.10-7","18.11.10-8","18.11.10-9"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-cvqu-2sh3-wnzt-7rp7.json"}},{"package":{"name":"teleport-18-fips","ecosystem":"Docker Hardened Images:Debian:13","purl":"pkg:deb/dhi/teleport-18-fips"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"18.11.1-2"}]}],"versions":["18.11.1-10","18.11.1-11","18.11.1-12","18.11.1-13","18.11.1-14","18.11.1-15","18.11.1-16","18.11.1-17","18.11.1-18","18.11.1-2","18.11.1-3","18.11.1-4","18.11.1-5","18.11.1-6","18.11.1-7","18.11.1-8","18.11.1-9","18.11.10-0","18.11.10-1","18.11.10-10","18.11.10-11","18.11.10-12","18.11.10-2","18.11.10-3","18.11.10-4","18.11.10-5","18.11.10-6","18.11.10-7","18.11.10-8","18.11.10-9"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-cvqu-2sh3-wnzt-7rp7.json"}},{"package":{"name":"teleport-18","ecosystem":"Docker Hardened Images:Debian:13","purl":"pkg:deb/dhi/teleport-18"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"18.11.1-2"}]}],"versions":["18.11.1-10","18.11.1-11","18.11.1-12","18.11.1-13","18.11.1-14","18.11.1-15","18.11.1-16","18.11.1-17","18.11.1-18","18.11.1-2","18.11.1-3","18.11.1-4","18.11.1-5","18.11.1-6","18.11.1-7","18.11.1-8","18.11.1-9","18.11.10-0","18.11.10-1","18.11.10-10","18.11.10-11","18.11.10-12","18.11.10-2","18.11.10-3","18.11.10-4","18.11.10-5","18.11.10-6","18.11.10-7","18.11.10-8","18.11.10-9"],"database_specific":{"source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-cvqu-2sh3-wnzt-7rp7.json","owner_kind":"HSP"}},{"package":{"name":"vector","ecosystem":"Docker Hardened Images:Debian:13","purl":"pkg:deb/dhi/vector"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.58.0-0"}]}],"versions":["0.58.0-0","0.59.0-0","0.60.0-0","0.61.0-0","0.62.0-0","0.62.0-1","0.62.0-2"],"database_specific":{"source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-cvqu-2sh3-wnzt-7rp7.json","owner_kind":"HSP"}}],"schema_version":"1.9.2"}