4 ms·
> Too many of us are so used to git clone'ing a repo and building the software with make or its descendants that we overlook the security considerations. The i
by koolba 8y ago
> Too many of us are so used to git clone'ing a repo and building the software with make or its descendants that we overlook the security considerations.
The issue here is that the "git clone ..." allows for arbitrary code execution so the flow of 1) clone 2) analyze 3) make breaks at step 1.
Looks like it's back to tarballs for me.
- tetha 8y agoThis is going to be interesting for the go-guys, since a lot of go package management is built around git clones. It's probably fine for things hosted on gitlab, github or bitbucket, and then you missed that one sneaky little dependency stabbing you in the back.
- lolc 8y agoWhy is it more interesting for the go packaging situation? As far as I'm aware, most packaging systems run scripts from inside the packages anyway. If you're running the packages' scripts, being vulnerable to this is a side-note. You have to trust the packagers anyway.
- cesarb 8y agoFrom what I understood, it's only "git clone --recursive"/"git clone --recurse-submodules" or "git submodule init ..." that's vulnerable, not bare "git clone". So the flow of (1) clone (2) look at .gitmodules (3) git submodule init (4) analyze would still work.
- jacquesm 8y agoEven with tarballs all it takes is one fuck-up in a script and your homedirectory is gone. In that sense nothing is safe. You could of course audit all the code that the makefile or build script executes but I really don't know anybody that would do that for anything beyond the trivial. We've been totally conditioned to just wget some archive, unpack it and build it, and even if git clone takes it one step further in day-to-day practice there is no difference between the two.
- shawnz 8y agoI think the parent's concern is that there should at least be SOME way to audit everything. That doesn't necessarily mean that everyone ought to be doing it every time they clone a repo.
- jacquesm 8y agoMost web interfaces to git will allow you to review the repo, if you blindly clone some repo that someone asks you to clone recursively I would see that mostly as a social engineering hack with the technical hook than a purely technical hack. And depending on the sophistication you might want to do that in a chrooted environment or a VM.
- tedunangst 8y agoThere's no way to know if what you see on the web will be what you clone. The inspection must occur locally.
- ivank 8y ago> Looks like it's back to tarballs for me. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=290435 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=290435
- ajross 8y ago> The issue here is that the "git clone ..." allows for arbitrary code execution It does not, actually. It's the submodule steps that create the vulnerability, and those have to be done manually. There are no standard or automated ways of pulling submodules, every project that uses them has its own scheme and provides its own build instructions. Frankly they're pretty obscure and in most communities replaced by tricks like npm's dependency management instead. It's a goof, and fixed, but even for the most naive users the exposure is fairly low. It's true that it happens early in the process, but it's not true that a simple git clone command is a vector.
- jakobegger 8y agoHave you ever looked at a makefile before calling make? A typical makefile might take days to audit. I’m pretty sure that it would be trivial to hide malicious code in a tarball that you wouldn’t find (especially if you’re not expecting it).