Skip to content

Encryption passphrase briefly visible in the process table during automated encrypted install #182

Description

@ggiesen

Summary

During an encrypted install the LUKS passphrase is passed through a shell command line, so it is briefly readable from the process table (ps) by any local user while the disk is being encrypted.

Affected path

GUI "Automated Installation — erase a disk and install" with the Encrypt checkbox enabled (setup.luks). finish_installation()create_partitions() runs cryptsetup luksFormat then luksOpen on the root partition.

Impact

Local disclosure of the disk-encryption passphrase. Any unprivileged local account on the live session that runs ps during the luksFormat/luksOpen window reads the passphrase the operator typed. shlex.quote only guards shell metacharacters; it does not keep the value out of the process table.

Root cause

create_partitions() builds os.system("echo -n %s | cryptsetup luksFormat ..." % shlex.quote(passphrase)). os.system runs /bin/sh -c "<string>", so the whole command string — passphrase included — sits in /bin/sh's argv and is visible to ps for the duration of the cryptsetup call. Both the luksFormat and luksOpen calls are affected.

Found while developing #180. Fix in the linked PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions