Disk encryption key and WireGuard key visible in /proc/PID/cmdline
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- linux, rust
- Ambito
- operating-systems, security
Direzione di ricerca
Esamina dstack/dstack-util/src/system_setup.rs, iniziando da setup_disk_encryption() e dalla configurazione di WireGuard che invoca wg set. Verifica se le chiavi della crittografia del disco e di WireGuard compaiono in /proc/*/cmdline, quindi valuta stdin per cryptsetup e setconf con una configurazione temporanea protetta per WireGuard. Il lavoro è completato quando nessuna delle due chiavi viene passata come argomento della riga di comando o in una pipeline di shell e la configurazione esistente continua a funzionare correttamente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Rust
- Stelle
- 551
- Fork
- 97
- Merge medio
- 19h 22m
- PR unite (30g)
- 109
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Dstack-TEE/dstack
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
Dstack-TEE/dstack#1301 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
Dstack-TEE/dstack#1300 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
Dstack-TEE/dstack#1299 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
Dstack-TEE/dstack#1298 ·
-
P0
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Dstack-TEE/dstack#1297 ·
Tutte le issue di Dstack-TEE/dstack
Issue simili
-
Replayed reasoning items send "content": null, which the Responses API schema does not permit Apertabug CLI custom-model
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
rust-bitcoin/rust-bitcoin#6930 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
fulcrumgenomics/ferro-hgvs#2251 ·
-
A-allocators A-docs C-enhancement T-libs
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100