Lix allows configuration which makes everyone inside the sandbox effectively root #242
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
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#242
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?
Describe the bug
Well, not a bug exactly but currently Lix allows the user to implicitly set the build user group to root. This used to be disallowed, but because it broke RPM builds someone decided to ifdef it out 16 years ago :^)
98968fbb63
just for the code to finally be completely removed a bit over a year ago479c011784
Steps To Reproduce
build-users-group =
to nix configExpected behavior
Nix should always default to using the
nixbld
group, or at least should do so when it's running as rootnix --version
outputAll nix versions since circa 2008
Additional context
IMO we don't necessarily need to disallow setting
build-users-group = root
, even though there may be hardly any reason to do so, but defaulting to the group of the user who's running the process is badI think we should probably disallow setting
build-users-group = root
and let whoever (probably nobody) be grumpy about it breaking their special use case that we probably should not support to begin with.Also nice CTF challenge :P https://jade.fyi/blog/reproducible-pwning-writeup/
@jade wants to kill NixOS CTF challenges this is so sad (jk next year we'll have a Nix 0day dw)
Wouldn't this affect single-user Lix installations?
It shouldn't since the worst offender here is "if
build-users-group
is set to empty, default to running user's group" which is a bad default. And as a bonus disallowing it to beroot
since putting root inside the sandbox is universally a bad ideaYeah, this seems reasonable as a resolution. Action items:
When using multi-user mode the daemon should probably just always fail to build and complain when the effective build-users-group is root.
This still allows building as root in single-user mode, but it might be worth it to add an option that needs to be set explicitly to allow running single-user mode as root, and try to get users to instead to use the nix daemon with dedicated build-users
The treatment of empty values seems like a great way to open another can of worms and probably warrants another issue to maybe fix option parsing and not parse an empty value as distinct from an unset option. And for the parse instead either reject configs containing empty values, or when an option has an empty value either ignoring the line or unsetting the value of that option to default.