RUSTSEC-2026-0418: libz-sys build script leaks environment variables in the build directory
Maintainer thường phản hồi trong vòng 2 ngày
Một pull request liên quan đã được merge.
- #1396 của @sentry-junior — đã merge
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust
- Lĩnh vực
- build-system, security
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Rust
- Star
- 754
- Fork
- 192
- Merge trung bình
- 2 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 21
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của getsentry/sentry-rust
-
breaking change
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
getsentry/sentry-rust#1387 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
breaking change Rust
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
getsentry/sentry-rust#1386 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
breaking change Rust Task
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
getsentry/sentry-rust#1345 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Pin Rust toolchainĐang mởRust Task
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
getsentry/sentry-rust#933 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Spans Task Traces
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
getsentry/sentry-rust#1401 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của getsentry/sentry-rust
Issue tương tự
-
binding:python bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
coollabsio/orbit#72 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
bug order-flow studies ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
userFRM/egui-charts#2417 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 2 ngày