ChainguardのMelangeにおけるパストラバーサルの脆弱性
タイトル ChainguardのMelangeにおけるパストラバーサルの脆弱性
概要

melangeは宣言的パイプラインを使用してapkパッケージを構築することを可能にします。バージョン0.32.0から0.43.4未満の間、melangeの設定ファイルに影響を与えられる攻撃者(例えばプルリクエスト駆動のCIやビルド・アズ・ア・サービスのシナリオを通じて)は、`pipeline[].uses`に"../"を含む値や絶対パスを設定できました。`pkg/build/compile.go`内の`(*Compiled).compilePipeline`関数は`uses`を検証せずに`filepath.Join(pipelineDir, uses + ".yaml")`に直接渡していたため、解決されたパスが各`--pipeline-dir`を逸脱し、melangeプロセスがアクセス可能な任意のYAML解析可能ファイルを読み取る可能性がありました。読み込まれたファイルはその後melangeパイプラインとして解釈され、その`runs:`ブロックはビルドサンドボックス内で`/bin/sh -c`経由で実行されます。したがって、木構造外のファイルからのシェルコマンドがビルド中に実行され、通常はインツリーのパイプライン定義をカバーするレビュー境界を回避できます。この問題はmelange v0.43.4でコミット5829ca4により修正されました。修正では、絶対パスや".."を含む`uses`の値を拒否し、(`filepath.Clean`の後に`filepath.Rel`を使って)解決されたターゲットがパイプラインディレクトリ内に留まることを検証しています。回避策としては、信頼できるソースからの設定ファイルに対してのみ`melange build`を実行してください。ユーザー提供のmelange設定をビルドするCIシステムでは、`pipeline[].uses`の値に対して手動レビューを導入し、".."や先頭に"/"を含むものを拒否することでビルドを制御してください。

想定される影響 当該ソフトウェアが扱う全ての情報が外部に漏れる可能性があります。 また、当該ソフトウェアが扱う情報の一部が書き換えられる可能性があります。 さらに、当該ソフトウェアは停止しません。 そして、この脆弱性を悪用した攻撃の影響は、他のソフトウェアには及びません。 
対策

正式な対策が公開されています。ベンダ情報を参照して適切な対策を実施してください。

公表日 2026年4月24日0:00
登録日 2026年4月30日12:11
最終更新日 2026年4月30日12:11
CVSS3.0 : 警告
スコア 6.1
ベクター CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N
影響を受けるシステム
Chainguard
Melange 0.32.0 以上 0.43.4 未満
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
ベンダー情報
変更履歴
No 変更内容 変更日
1 [2026年04月30日]
  掲載
2026年4月30日12:11

NVD脆弱性情報
CVE-2026-29050
概要

melange allows users to build apk packages using declarative pipelines. Starting in version 0.32.0 and prior to version 0.43.4, an attacker who can influence a melange configuration file — for example through pull-request-driven CI or build-as-a-service scenarios — could set `pipeline[].uses` to a value containing `../` sequences or an absolute path. The `(*Compiled).compilePipeline` function in `pkg/build/compile.go` passed `uses` directly to `filepath.Join(pipelineDir, uses + ".yaml")` without validating the value, so the resolved path could escape each `--pipeline-dir` and read an arbitrary YAML-parseable file visible to the melange process. Because the loaded file is subsequently interpreted as a melange pipeline and its `runs:` block is executed via `/bin/sh -c` in the build sandbox, this additionally allowed shell commands sourced from an out-of-tree file to run during the build, bypassing the review boundary that normally covers the in-tree pipeline definition. The issue is fixed in melange v0.43.4 via commit 5829ca4. The fix rejects `uses` values that are absolute paths or contain `..`, and verifies (via `filepath.Rel` after `filepath.Clean`) that the resolved target remains within the pipeline directory. As a workaround, only run `melange build` against configuration files from trusted sources. In CI systems that build user-supplied melange configs, gate builds behind manual review of `pipeline[].uses` values and reject any containing `..` or leading `/`.

公表日 2026年4月24日9:16
登録日 2026年4月25日4:07
最終更新日 2026年4月27日23:31
影響を受けるソフトウェアの構成
構成1 以上 以下 より上 未満
cpe:2.3:a:chainguard:melange:*:*:*:*:*:go:*:* 0.32.0 0.43.4
関連情報、対策とツール
共通脆弱性一覧