Disk encryption key and WireGuard key visible in /proc/PID/cmdline
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- linux, rust
調査の方向性
dstack/dstack-util/src/system_setup.rs を確認し、setup_disk_encryption() と wg set を呼び出す WireGuard のセットアップから始めます。ディスク暗号化と WireGuard のキーが /proc/*/cmdline に現れるかを確認し、WireGuard 用の保護された一時設定を使って cryptsetup と setconf の stdin を評価します。完了の条件は、どちらのキーもコマンドライン引数またはシェルパイプラインで渡されず、既存のセットアップが引き続き正常に成功することです。
索引モデルが issue の本文から書いたものです。
説明
The setup_disk_encryption() function in dstack/dstack-util/src/system_setup.rs passes the disk encryption key via the kernel command line when calling cryptsetup, which exposes the key in /proc/cmdline to any process in the CVM.
Root Cause
The disk encryption key is passed to cryptsetup via a shell pipeline that makes it visible in /proc/PID/cmdline:
echo -n "$disk_crypt_key" | cryptsetup luksOpen ...
Similarly, the WireGuard private key is passed via wg set command arguments, which are also visible in procfs. Any process inside the CVM can read /proc/*/cmdline to extract these keys during the brief window when the commands are running.
Attack Path
- Attacker compromises any process inside the CVM
- Attacker continuously polls
/proc/*/cmdlinefor processes containing key material - During CVM boot or WireGuard setup, attacker captures the disk encryption key or WireGuard private key
- With the disk encryption key, attacker can decrypt the persistent storage offline
- With the WireGuard key, attacker can decrypt or inject network traffic
Impact
Cryptographic key material is transiently exposed to all processes via procfs. While the window is brief (duration of the cryptsetup/wg commands), a persistent attacker polling procfs can reliably capture the keys.
Suggested Fix
Pass keys via stdin instead of command line arguments or shell pipelines, so no key material appears in /proc/PID/cmdline:
use std::io::Write;
use std::process::{Command, Stdio};
// For cryptsetup: read key from stdin using --key-file=-
let mut child = Command::new("cryptsetup")
.args(["luksOpen", "--key-file", "-", "/dev/vda", "cryptroot"])
.stdin(Stdio::piped())
.spawn()?;
if let Some(mut stdin) = child.stdin.take() {
stdin.write_all(disk_crypt_key.as_bytes())?;
}
let status = child.wait()?;
For WireGuard, use wg setconf with a configuration file (on tmpfs with 0o600 permissions) instead of passing the key on the command line.
Note: This issue was created automatically. The vulnerability report was generated by Claude and has not been verified by a human.
- 主要言語
- Rust
- スター
- 551
- フォーク
- 97
- 平均マージ
- 19時間 22分
- マージ済み PR(30日)
- 109
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Dstack-TEE/dstack のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
Dstack-TEE/dstack#1301 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
Dstack-TEE/dstack#1300 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
Dstack-TEE/dstack#1299 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
Dstack-TEE/dstack#1298 ·
-
P0
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
Dstack-TEE/dstack#1297 ·
Dstack-TEE/dstack の issue をすべて見る
似ている issue
-
bug CLI custom-model
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
rust-bitcoin/rust-bitcoin#6930 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
fulcrumgenomics/ferro-hgvs#2251 ·
-
A-allocators A-docs C-enhancement T-libs
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100