[Nix#9649] accept-flake-config
allows running commands as root
#79
Labels
No labels
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/store
bug
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
RFD
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
ux
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#79
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Upstream-Issue: NixOS/nix#9649
Describe the bug
With the
--accept-flake-config
option oraccept-flake-config = true
innix.conf
, any flake build (nix build
,nix develop
,nix run
, etc.) gets root access.Steps To Reproduce
Demo here: https://github.com/9999years/accept-flake-config-demo/
Expected behavior
I expected
accept-flake-config
might do something like use untrusted caches, but "root access" is pretty extreme, and the manual doesn't say "enabling this setting is equivalent to giving root access to any flake you interact with" when it describesaccept-flake-config
.nix-env --version
outputnix-env (Nix) 2.18.1
Additional context
I don't think this is a bug per-se, in that the behavior is intended, but I don't think this should be allowed in the general case, and even if it is the manual should make it a lot clearer how dangerous this setting is.
It might be nice to have
accept-flake-config
take a list of settings instead, so that (e.g.)accept-flake-config = allow-import-from-derivation substituters
would allow flakes to set theallow-import-from-derivation
orsubstituters
options, but notbuilders
orpost-build-hook
.Priorities
Add 👍 to issues you find important.