Description
Adding a user to trusted-user
amounts to local privilege escalation, granting root access without password. The documentation also notes this.
https://nix.dev/manual/nix/2.24/command-ref/conf-file.html#conf-trusted-users
The exploit is trivial and easily hidden eg. in a maliciously crafted flake. accept-flake-config
is another dangerous option that should be warned against, and the two insecure options amplify each other.
While avoiding trusted-users
, binary caches can be used by adding them to the system nix.conf
in trusted-binary-keys
and substituters
(or trusted-substituters
and enabled via CLI or user nix.conf
if not used all the time).
om health
should do the opposite of what it currently does: check if any users or groups other than root
are present, report an error and recommend removing them.