5 ms·
Other than being in a different directory, what difference is that going to make? You are going to have both in your $PATH in order to run the binaries, so if a
by lucaspiller 10y ago
Other than being in a different directory, what difference is that going to make? You are going to have both in your $PATH in order to run the binaries, so if an attacker can write to either bad stuff could happen.
Also you can actually install it wherever you like, this is just the default/recommended location:
https://github.com/Homebrew/brew/blob/master/docs/Installation.md#untar-anywhere https://github.com/Homebrew/brew/blob/master/docs/Installati...
- stcredzero 10y agoOther than being in a different directory, what difference is that going to make? Because, if they had picked their own directory and not a standard one like /usr/local/bin, then they would only be putting the homebrew installed binaries at risk. It would be better for defense in depth if they had not. As it is, all of their users are incentivized to unnecessarily give up a little security in favor of convenience. It's precisely that mindset that's one of the "enemies." (The other "enemy" is security without concern for convenience. We know from practice that's just as broken.) You are going to have both in your $PATH in order to run the binaries, so if an attacker can write to either bad stuff could happen. Normally, you'd need root privileges to write to /usr/local/bin. Since it's a very popular location for installing 3rd party tools, homebrew is effectively incentivizing users to have more writable executables than otherwise. Homebrew also aids security by making it easier for devs to keep executables updated. They also deserve credit for making something useful. I use homebrew as well. However, I still really wish they would've made a different decision about /usr/local/bin.
- lisper 10y ago/usr/local/bin is a global resource populated by binaries run by many different users including root. Making it user-writable opens the door to privilege escalation attacks by replacing binaries that are then run by other users.
- falsedan 10y agoWhy would using /opt/homebrew/bin stop these sorts of attacks?
- lisper 10y agoIt would prevent privilege escalation attacks on binaries that I have already installed in /usr/local/bin. Yes, packages installed in /opt/homebrew/bin could be attacked separately, but at least the vulnerable binaries are isolated so it's easier to keep an eye on them and make sure none of them are ever run with privileges. But you're right: to really fix this problem requires that homebrew change its installation process entirely.