| タイトル | ChainguardのMelangeにおけるパストラバーサルの脆弱性 |
|---|---|
| 概要 | melangeは宣言的パイプラインを使用してapkパッケージを構築することを可能にします。バージョン0.32.0から0.43.4の前までの間において、`melange lint --persist-lint-results`(オプトインフラグで、`melange build --persist-lint-results`でも使用可能)は、出力ファイルパスを`--out-dir`とAPKの.PKGINFO制御ファイルから読み取った`arch`および`pkgname`の値を結合して構築していました。影響を受けるバージョンでは、これらの値にパス区切り文字や`..`シーケンスの検証が行われていなかったため、melangeベースのlint/buildパイプラインにAPKを提供できる攻撃者(例:サードパーティAPKをlintするCIやサービスとしてのビルド)が、melangeプロセスが到達可能な任意の`.json`パスに`lint-pkgname-pkgver-repoch.json`を書き込ませる可能性がありました。書き込まれるファイルは部分的に攻撃者に影響された内容を持つJSONのlintレポートです。直接的なコード実行経路はありませんが、書き込みによりファイルシステム上の他のJSONアーティファクトを上書きしてしまう恐れがあります。本問題は`--persist-lint-results`を明示的に渡したデプロイメントにのみ影響し、このフラグはデフォルトで無効です。修正はmelange v0.43.4で行われ、`arch`と`pkgname`に`..`、`/`、および`filepath.Separator`の検証を`pkg/linter/results.go`のパス構築前に追加しました(コミット84f3b45)。回避策としては、.PKGINFOの内容を完全に信頼できないAPKのlintやビルド時に`--persist-lint-results`を渡さないことが推奨されます。また、低権限ユーザーでmelangeを実行し、書き込みを隔離されたディレクトリに制限することも影響を軽減します。 |
| 想定される影響 | 当該ソフトウェアが扱う情報について、外部への漏えいは発生しません。 また、当該ソフトウェアが扱う情報の一部が書き換えられる可能性があります。 さらに、当該ソフトウェアは停止しません。 そして、この脆弱性を悪用した攻撃の影響は、他のソフトウェアには及びません。 |
| 対策 | 正式な対策が公開されています。ベンダ情報を参照して適切な対策を実施してください。 |
| 公表日 | 2026年4月24日0:00 |
| 登録日 | 2026年4月30日12:11 |
| 最終更新日 | 2026年4月30日12:11 |
| CVSS3.0 : 低 | |
| スコア | 3.3 |
|---|---|
| ベクター | CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N |
| Chainguard |
| Melange 0.32.0 以上 0.43.4 未満 |
| No | 変更内容 | 変更日 |
|---|---|---|
| 1 | [2026年04月30日] 掲載 |
2026年4月30日12:11 |
| 概要 | melange allows users to build apk packages using declarative pipelines. Starting in version 0.32.0 and prior to version 0.43.4, `melange lint --persist-lint-results` (opt-in flag, also usable via `melange build --persist-lint-results`) constructs output file paths by joining `--out-dir` with the `arch` and `pkgname` values read from the `.PKGINFO` control file of the APK being linted. In affected versions these values were not validated for path separators or `..` sequences, so an attacker who can supply an APK to a melange-based lint/build pipeline (e.g. CI that lints third-party APKs, or build-as-a-service) could cause melange to write `lint-<pkgname>-<pkgver>-r<epoch>.json` to an arbitrary `.json` path reachable by the melange process. The written file is a JSON lint report whose content is partially attacker-influenced. There is no direct code-execution path, but the write can clobber other JSON artifacts on the filesystem. The issue only affects deployments that explicitly pass `--persist-lint-results`; the flag is off by default. The issue is fixed in melange v0.43.4 by validating `arch` and `pkgname` for `..`, `/`, and `filepath.Separator` before path construction in `pkg/linter/results.go` (commit 84f3b45). As a workaround, do not pass `--persist-lint-results` when linting or building APKs whose `.PKGINFO` contents are not fully trusted. Running melange as a low-privileged user and confining writes to an isolated directory also limits impact. |
|---|---|
| 公表日 | 2026年4月24日9:16 |
| 登録日 | 2026年4月25日4:07 |
| 最終更新日 | 2026年4月27日23:42 |
| 構成1 | 以上 | 以下 | より上 | 未満 | |
| cpe:2.3:a:chainguard:melange:*:*:*:*:*:go:*:* | 0.32.0 | 0.43.4 | |||