Something I see come up again and again is when package managers allow arbitrary IO to be executed as part of installing a package. This is pretty common in languages like Python, JS, etc where a package will include some C code that it can call out to for the obvious performance reasons. To support this, the language package manager has some hooks to run make, etc.
Of course, this is a huge security issue. A package that gets compromised will then be able to run whatever malicious code it wants just by you running your normal dependency install steps. (AFAIK, this is part of what happened with the recent compromised LiteLLM packages.)
My thoughts here are
- seems like the zig build system does allow arbitrary IO in my build script. when I include others’ packages as dependencies, is this running their build script at all or just including some code? does this have the same general threat vector or are we generally okay here?
- if this isn’t a problem that the zig build system allows, maybe there’s something interesting here for other language’s package managers to take advantage of. e.g. imagine a JS package installer that embeds zig and allows packages to include what they need so that zig could compile the lower level dependency for the end user’s system, but without opening the door to arbitrary IO.