RUSTSEC-2026-0418: libz-sys build script leaks environment variables in the build directory
Los mantenedores suelen responder en 4 días
Ya se ha fusionado un pull request relacionado.
- #1396 de @sentry-junior — fusionado
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- rust
- Área
- build-system, security
Línea de trabajo
Start by checking whether the workspace's Cargo.lock resolves libz-sys to a version below 1.1.31, and whether any Cargo.toml pins cc or libz-sys directly. Read the RUSTSEC advisory linked in the issue to confirm the patched range. Done when libz-sys resolves to 1.1.31 or later (or the affected build path is confirmed unreachable) and the workspace builds and its tests pass.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
libz-sys build script leaks environment variables in the build directory
| Details | |
|---|---|
| Package | libz-sys |
| Version | 1.1.30 |
| URL | https://github.com/rust-lang/libz-sys/pull/280 |
| Date | 2026-10-28 |
| Patched versions | >=1.1.31 |
| Unaffected versions | <1.0.21 |
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 [email protected] 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.
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:
println!("running {:?}", cmd);
On Unix, Debug impl for std::process::Command prints every environment
variable explicitly set on the command. Before [email protected], its
Tool::to_command() set only a few compiler-specific variables. Starting with
[email protected] (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 with -vv.
The probe runs for a default libz-sys build, including when pkg-config finds
zlib, unless one of these applies:
- the target is Windows, Android, Haiku or OpenHarmony
- static linking is requested via the
staticfeature orLIBZ_SYS_STATIC=1 - the
zlib-ngfeatures are enabled withoutstock-zlib
Mitigations
Fixed in [email protected], which no longer logs the probe command.
If you cannot upgrade, here are some workarounds:
- Build with
LIBZ_SYS_STATIC=1or thestaticfeature, which skips the probe. - Pin
ccto a release before 1.6.0 (cargo update cc --precise <version>).
Note that upgrading libz-sys does not remove values already written. If an
affected build already ran with secrets in its environment, clear CI caches and
stored artifacts containing its
target/build directory,
and consider rotating those secrets.
See advisory page for additional details.
- Lenguaje dominante
- Rust
- Estrellas
- 755
- Forks
- 192
- Merge medio
- 3 d 21 h
- PR fusionados (30 d)
- 21
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de getsentry/sentry-rust
-
breaking change
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
getsentry/sentry-rust#1387 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
breaking change Rust
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
getsentry/sentry-rust#1386 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
breaking change Rust Task
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
getsentry/sentry-rust#1345 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
Pin Rust toolchainAbiertoRust Task
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
getsentry/sentry-rust#933 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
Support setting span status from tracing span fieldsPosiblemente ocupada @sentry-junior la tomó hace 1 día. AbiertoFeature Rust Spans
Dificultad 4/5 3-5 días Aptitud para principiantes 58/100
getsentry/sentry-rust#1398 · 1 comentario ·
Los mantenedores suelen responder en 4 días
Todos los issues de getsentry/sentry-rust
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
longbridge/gpui-kit#3795 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
saltnpepper97/halley#271 ·
Los mantenedores suelen responder en 1 día
-
config: `command` in `[commands.<name>]` is silently ignored when a positional command is givenAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
akitaonrails/ai-jail#216 ·
Los mantenedores suelen responder en 1 día
-
Poetry updater rejects OR (||) Python constraints in PyprojectPreparer#update_python_requirementAbiertoL: python L: ruby:bundler
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
dependabot/dependabot-core#16819 ·
Los mantenedores suelen responder en 1 día