News for hackers. Stuff that matters.
Re:Remote code execution, git, and OS X by atdt on Monday April 18, 2016 @02:23AM (#11518018)
It's a bit too precarious to be an adequate solution, in my opinion. It depends on /usr/local/bin always being ahead of /usr/bin in $PATH, and on scripts never invoking the system git via its full path, and on Homebrew never accidentally uninstalling git due to a botched upgrade. Not to mention the fact that Homebrew itself uses the system git to install itself.
Re:Remote code execution, git, and OS X by opejn on Monday April 18, 2016 @06:20PM (#11523543)
> Not to mention the fact that Homebrew itself uses the system git to install itself.

To me, this is the biggest problem, and it's not just Homebrew. Any source package manager that uses Git will potentially have this problem. With a vulnerable Git on your system, you have to second-guess every build script you ever run that might make use of Git, to make sure it obeys the path you set instead of choosing its own.

Re:Remote code execution, git, and OS X by tobylane on Monday April 18, 2016 @05:48AM (#11518707)
When would the order of $PATH vary?
Re:Remote code execution, git, and OS X by OJFord on Monday April 18, 2016 @06:22AM (#11518804)
When someone's changed it? Which people do _all the time_.
Re:Remote code execution, git, and OS X by tobylane on Tuesday April 19, 2016 @08:52AM (#11526551)
Mine is changed for Heroku, but it only prepends. I've never seen $PATH be rearranged.
Re:Remote code execution, git, and OS X by OJFord on Tuesday April 19, 2016 @01:38PM (#11528652)
If you prefix it with something already in there then it's effectively rearranged.

You wouldn't do this deliberately, of course, but it happens a lot - people end up with massive PATHs because they blindly prefix when something's gone wrong and it _may_ be the solution.

Re:Remote code execution, git, and OS X by tobylane on Thursday April 21, 2016 @06:11AM (#11540781)
I was thinking prepending and appending aren't rearranging.
Re:Remote code execution, git, and OS X by OJFord on Friday April 29, 2016 @07:58PM (#11599535)
The important part of my above sentence was "with something already there".

If $PATH == 'a:b' and you do `export PATH=b:$PATH, then you've basically rearranged it. It may as well be 'b:a'.

Re:Remote code execution, git, and OS X by cosmotron on Monday April 18, 2016 @01:17PM (#11521517)
To give a concrete example, OS X 10.9 (Mavericks) has `/usr/bin` listed before `/usr/local/bin` in `/etc/paths`. This was flipped in 10.10 and up.