As many of you probably already know, there was a recent discovery of malware distributed through npm dependencies in several AUR (Arch User Repository) packages. A good preliminary analysis of its behavior can be found in this blog post.
As a former Arch user who migrated to NixOS about a year ago, this discovery has made me wonder whether nixpkgs could be susceptible to a similar attack in the future, and more generally about the security aspects of NixOS compared to other distributions. If possible, I’d appreciate it if more experienced users could help clarify a few questions:
- Would malware of this kind still be effective on NixOS system (featuring a read-only Nix store)?
- Does the isolation between packages and dependencies provided by Nix affect this type of vulnerability in any meaningful way?
- Assuming a similar incident were to occur in Nixpkgs, what would be the most likely fix from upstream? (My first guess would be to sanitize all affected packages and rebase all the commits that reference them).
- What would be the most effective remediation for an end user? Would a simple update followed by
nix store gcbe sufficient, or would a full reinstall be recommended? - Are there any additional modules or configuration options that could help reduce the attack surface? For example, would an impermanent setup that wipes
/on every reboot provide any meaningful protection or limit the malware’s persistence?
Thank you in advance for helping clarify my doubts! ![]()