Disk encryption key and WireGuard key visible in /proc/PID/cmdline
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 48/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- linux, rust
- Bereich
- operating-systems, security
Rechercherichtung
Überprüfe dstack/dstack-util/src/system_setup.rs, beginnend mit setup_disk_encryption() und dem WireGuard-Setup, das wg set aufruft. Prüfe, ob die Schlüssel für die Festplattenverschlüsselung und WireGuard in /proc/*/cmdline erscheinen, und bewerte stdin für cryptsetup und setconf mit einer geschützten temporären Konfiguration für WireGuard. Als erledigt gilt, dass keiner der beiden Schlüssel als Kommandozeilenargument oder in einer Shell-Pipeline übergeben wird und das bestehende Setup weiterhin erfolgreich ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Rust
- Sterne
- 551
- Forks
- 97
- Ø Merge
- 1 T. 8 Std.
- Gemergte PRs (30 T.)
- 182
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus Dstack-TEE/dstack
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
Dstack-TEE/dstack#1384 ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 30/100
Dstack-TEE/dstack#1301 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 55/100
Dstack-TEE/dstack#1300 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
Dstack-TEE/dstack#1299 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
Dstack-TEE/dstack#1298 ·
Alle Issues in Dstack-TEE/dstack
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
-
bug core
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
-
JIT-compiled number -> Decimal conversion silently overflows instead of raising DECIMAL_OVERFLOW Offenfuzz
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
ClickHouse/ClickHouse#122114 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
linebender/vello_svg#90 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100