RUSTSEC-2026-0418: libz-sys build script leaks environment variables in the build directory
メンテナーはふだん 3 日以内に返信
関連するプルリクエストがすでにマージされています。
- #1396 @sentry-junior による — マージ済み
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- rust
- 領域
- build-system, security
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Rust
- スター
- 754
- フォーク
- 192
- 平均マージ
- 2日 23時間
- マージ済み PR(30日)
- 20
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
getsentry/sentry-rust のほかの issue
-
breaking change
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
getsentry/sentry-rust#1387 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
breaking change Rust
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
getsentry/sentry-rust#1386 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
breaking change Rust Task
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
getsentry/sentry-rust#1345 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
Pin Rust toolchainオープンRust Task
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
getsentry/sentry-rust#933 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
Spans Task Traces
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
getsentry/sentry-rust#1401 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
getsentry/sentry-rust の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
apache/datafusion-iceberg#100 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: cua-driver skill fails Agent Skills frontmatter validation対応中かも @Mearman が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
area/tools bug session-analysis
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
oracle/rust-oracledb#66 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信