[Low] CSI plugin builds staging directories from storage_volume_id without a containment check
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
調査の方向性
internal/volume/csi/plugin.go の stageVolume と unstageVolume がパスを構築する箇所を読み、次に resources.ValidateStorageVolumeID が ID をどのように検証するかを確認します。該当する単体テストに ../x と a/b のケースを追加し、どちらのステージング操作もステージングプレフィックス外のパスにアクセスしないことを確認します。
索引モデルが issue の本文から書いたものです。
説明
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
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
agent-substrate/substrate のほかの issue
-
area/security kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
agent-substrate/substrate#2932 ·
メンテナーはふだん 1 日以内に返信
-
[Low] guestVolumeSource can map host paths containing ".." outside the microVM guest share対応中かも @jiayimeow が 1 日前に担当しました。 オープンarea/security kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
agent-substrate/substrate#2920 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[Low] setupImageVolumes builds host mount paths from vol.Name without a containment check対応中かも @abhisheksharma2411 が今日担当しました。 オープンarea/security kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
agent-substrate/substrate#2919 ·
メンテナーはふだん 1 日以内に返信
-
[Low] ate-api-server accepts client certificates chained to system roots when --pod-identity-ca-certs is unset対応中かも @abhisheksharma2411 が今日担当しました。 オープンarea/security kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
agent-substrate/substrate#2918 ·
メンテナーはふだん 1 日以内に返信
-
Cloud SQL backend: document (and optionally provision) Private Service Connect for ATE_API_POSTGRES_CLOUDSQL_IP_TYPE=psc対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンarea/dev-infra kind/docs kind/feature
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
agent-substrate/substrate#2875 ·
メンテナーはふだん 1 日以内に返信
agent-substrate/substrate の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
grafana/tempo-operator#1691 ·
メンテナーはふだん 1 日以内に返信
-
fix: presentation.go with mcp-table.go: the message for each MCP server comes back対応中かも @mge1512 が今日担当しました。 オープンbug
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
mark3labs/kit#242 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
slavakurilyak/awesome-ai-agents#827 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
bug P3
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
mpyw/declscope#262 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信