Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Disk encryption key and WireGuard key visible in /proc/PID/cmdline

Offen
#556 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

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

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

security security: hardening security: report

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

  1. Attacker compromises any process inside the CVM
  2. Attacker continuously polls /proc/*/cmdline for processes containing key material
  3. During CVM boot or WireGuard setup, attacker captures the disk encryption key or WireGuard private key
  4. With the disk encryption key, attacker can decrypt the persistent storage offline
  5. 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

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus Dstack-TEE/dstack

Alle Issues in Dstack-TEE/dstack

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.