/lib/cryptsetup/scripts/decrypt_derived reveals encryption keys to non-root processes
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| cryptsetup (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
Bug Description
Hi,
the shell script
/lib/cryptsetup
has several commands using a secret encryption key as a command line argument, such as
count="$(printf '%s' "$keys" | wc -l)"
printf '%s' "$keys"
Never ever put confidential data on command line, since command line arguments can be seen from all processes with ps
ProblemType: Bug
DistroRelease: Ubuntu 23.10
Package: cryptsetup 2:2.6.1-4ubuntu3
ProcVersionSign
Uname: Linux 6.5.0-26-generic x86_64
NonfreeKernelMo
ApportVersion: 2.27.0-0ubuntu5
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: LXQt
Date: Sun May 12 00:34:41 2024
InstallationDate: Installed on 2023-11-23 (170 days ago)
InstallationMedia: Lubuntu 23.10 "Mantic Minotaur" - Release amd64 (20231010)
SourcePackage: cryptsetup
UpgradeStatus: No upgrade log present (probably fresh install)
cmdline: BOOT_IMAGE=

BTW.,
_some_ shells do treat printf as an internal command, but you never really know, because the script hash-bangs /bin/sh, which could be any shell. Even internal commands can appear on the process list.