!ZRgXNaHrdpGqwUnGnj:nixos.org

NixOS Security Triage

745 Members
Coordination and triage of security issues in nixpkgs230 Servers

Load older messages


SenderMessageTime
29 Jun 2021
@hexa:lossy.networkhexa0.27.3 is also what we have in 20.09, so in theory we could bump it there as well21:10:33
@hexa:lossy.networkhexain other news: 25h support for 20.09 left on my clock (CEST)21:10:57
30 Jun 2021
@mingovanburne:matrix.orgmingovanburne joined the room.03:53:18
1 Jul 2021
@kunrooted:matrix.orgkunrootedasked on FP Slack, will ask in here as well11:18:33
@kunrooted:matrix.orgkunrooted okay so let's assume we have Situation like this:
we have two users, Adam and Eve, while Adam has root access/is root himself. Can Eve 'infect' his /nix/store with malicious Code? Also, how one can tell which packages in /nix/store belong to who? I think that replacing a binary is indeed possible, but it requires root access, so it would def. be a Post exploitation thing. What other security nightmares can we face except the atomic Upgrades and possibilities of supply chain attacks when it comes to /nix/store itself? Really, how one can tell which user can use which package? Is there a way to do so? Can Eve in given Situation 'inject' malicious Code into Adam's /nix/store?
11:18:36
@synthetica:matrix.orgSyntheticaIf you have root you can basically do anything, so...11:19:23
@kunrooted:matrix.orgkunrootedAnd how can I tell which user has an Access to certain packages? 11:20:02
@balsoft:balsoft.rubalsoftNix store is a large cache11:20:11
@roosemberth:orbstheorem.chRoosThe nix store is world readable. 11:20:20
@balsoft:balsoft.rubalsoftEverybody has write access11:20:23
@balsoft:balsoft.rubalsoft* Everybody has read access11:20:26
@synthetica:matrix.orgSyntheticaI suppose that if you have a SHA collision you can build an evil package that has the same derivation hash as a good package11:20:27
@balsoft:balsoft.rubalsoftallowedUsers have write access to new packages11:20:36
@balsoft:balsoft.rubalsofttrustedUsers basically have root so it doesn't matter11:20:45
@balsoft:balsoft.rubalsoft
In reply to @synthetica:matrix.org
I suppose that if you have a SHA collision you can build an evil package that has the same derivation hash as a good package
Yes
11:20:57
@balsoft:balsoft.rubalsoft
In reply to @kunrooted:matrix.org
okay so let's assume we have Situation like this:
we have two users, Adam and Eve, while Adam has root access/is root himself. Can Eve 'infect' his /nix/store with malicious Code? Also, how one can tell which packages in /nix/store belong to who? I think that replacing a binary is indeed possible, but it requires root access, so it would def. be a Post exploitation thing. What other security nightmares can we face except the atomic Upgrades and possibilities of supply chain attacks when it comes to /nix/store itself? Really, how one can tell which user can use which package? Is there a way to do so? Can Eve in given Situation 'inject' malicious Code into Adam's /nix/store?
So, yes, anybody can put (almost) anything in the nix store, but it doesn't matter
11:21:26
@kunrooted:matrix.orgkunrootedokay, great11:21:27
@roosemberth:orbstheorem.chRoosYou can always ask the nix daemon to build a derivation for you, but since it's hashed, you cannot replace a legitimate derivation unless you also happen to find a sha256 collision. 11:21:41
@balsoft:balsoft.rubalsoftAnother slight issue is if you have a sufficiently controlled and influential nondeterminism source in your dependency tree, another kind of attack is possible11:22:27
@kunrooted:matrix.orgkunrootedokay, and any other security risks related to /nix/store itself? 11:22:31
@kunrooted:matrix.orgkunrootedah, you type faster haha11:22:43
@kunrooted:matrix.orgkunrooted
In reply to @balsoft:balsoft.ru
Another slight issue is if you have a sufficiently controlled and influential nondeterminism source in your dependency tree, another kind of attack is possible
what do you mean exactly
11:22:59
@kunrooted:matrix.orgkunrootedinjection/hijack of some Kind? 11:23:12
@balsoft:balsoft.rubalsoftI can't give a concrete example right now but I think it could be possible11:23:48
@balsoft:balsoft.rubalsoft Imagine that somewhere in the build there's basically if some_nondeterministic_condition then echo "malicious stuff" >> $out/bin/foo 11:24:24
@kunrooted:matrix.orgkunrootedmy best idea was to inject a derivation which would build something like gtfo bin11:24:31
@balsoft:balsoft.rubalsoftThen Eve can figure out the dependency tree of the system, and build this nondeterministic derivation with the condition triggered before Adam does11:24:59
@balsoft:balsoft.rubalsoftBut it's such a low-possibility attack that a sha256 collision is more likely I think11:25:20
@philipp:xndr.dephilippRedacted or Malformed Event11:25:30
@balsoft:balsoft.rubalsoft
In reply to @kunrooted:matrix.org
my best idea was to inject a derivation which would build something like gtfo bin
What do you mean
11:25:46

Show newer messages


Back to Room ListRoom Version: 6