Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Low] CSI plugin builds staging directories from storage_volume_id without a containment check

オープン 初心者向け
#2,935 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go
領域
backend, security

調査の方向性

internal/volume/csi/plugin.go の stageVolume と unstageVolume がパスを構築する箇所を読み、次に resources.ValidateStorageVolumeID が ID をどのように検証するかを確認します。該当する単体テストに ../x と a/b のケースを追加し、どちらのステージング操作もステージングプレフィックス外のパスにアクセスしないことを確認します。

索引モデルが issue の本文から書いたものです。

説明

area/security kind/bug

Summary

stageVolume and unstageVolume in the CSI volume plugin build the staging path as filepath.Join(p.stagingDirPrefix, volumeID), then MkdirAll and later remove it. storage_volume_id is only checked for control characters and length, so a value containing / or .. would resolve outside stagingDirPrefix. The ID comes from the CSI provisioner and control plane, not from tenants, so this is defense in depth.

Details

internal/volume/csi/plugin.go#L296-L299:

stagingPath := filepath.Join(p.stagingDirPrefix, req.VolumeID)
if err := os.MkdirAll(stagingPath, 0750); err != nil {
	return "", fmt.Errorf("failed to create staging directory %q: %w", stagingPath, err)
}

#L344: stagingPath := filepath.Join(p.stagingDirPrefix, volumeID) (unstage, followed by removal of the staging dir).

storage_volume_id (pkg/proto/ateapipb/ateapi.proto#L507-L519) is "the storage system's own" format, validated only by resources.ValidateStorageVolumeID (control characters).

Impact

Low: the value is set by the provisioner when it creates the volume, not by an actor or template. A misbehaving or compromised CSI driver could return an ID that makes atelet create or remove directories outside the staging prefix on the node.

Suggested fix

Derive the staging directory from a hash of the volume ID (as kubelet does) instead of the raw ID, or reject IDs where !filepath.IsLocal(id). Add a unit test with ../x and a/b.

主要言語
Go
スター
5.7k
フォーク
612
平均マージ
2日 14時間
マージ済み PR(30日)
533

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

agent-substrate/substrate のほかの issue

agent-substrate/substrate の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。