News for hackers. Stuff that matters.
Re:Running "n stable" removed bin, lib, share, include direc... by benatkin on Sunday October 07, 2012 @05:58PM (#4624581)
He merged a pull request from someone he probably didn't know (new to node.js, different country). Without looking at the rest of the file it looks OK to me. That's probably what happened - he didn't get all of the program's relevant structure in his mind when he read the code.

https://github.com/visionmedia/n/pull/85/files#r1781158

Re:Running "n stable" removed bin, lib, share, include direc... by zobzu on Sunday October 07, 2012 @06:03PM (#4624593)
Which is slightly scary security wise. Over the large number of libs, programs, etc people often pull half-blind if the code looks "mostly ok and does what it says"

Except it can do also a lot of other bad things, and its too much to review. So in the end you trust the tree owner, and he blindly trust a zillion people.

I actually have zero good solution to this, but it'll be interesting when it is used for a large attack.

Re:Running "n stable" removed bin, lib, share, include direc... by biturd on Sunday October 07, 2012 @08:26PM (#4624954)
> I actually have zero good solution to this, but it'll > be interesting when it is used for a large attack.

I don't know what this software is or anything about it aside from an estimating that it appears from comments here and on GH that it's serious as it deletes highly important directories and is possibly a widely used software package.

Whenever I install from source I run the installer as non root. It will error on higher than my user privilege deletes telling me I need to be root. In this case I believe I would have seen the attempt to remove important directories as an error alert.

If I have to be root, running as non root first has helped me as a purely investigative method to installations.

What if everyone adopted an 'rm -rfi' type command for any deletes. Then you are asked: "You are about to remove $dir are you sure you are okay with this? Y/N?

In this case, what I don't get is how it's now been three days and there hasn't been a rollback, pulling of the software, patch, notice, billboard, radio announcement, Emergency Broadcast Syatem alert, or otherwise some way to halt this problem dead in it's tracks right this very second.

It's almost like: README This software is 'use at your own risk', etc., etc., etc., see Hacker News for any potentially dangerous side-effects caused by installing this software.

Re:Running "n stable" removed bin, lib, share, include direc... by cma on Sunday October 07, 2012 @11:14PM (#4625363)
Typically anything owned by your user is much more important to you than anything owned by root (from the perspective of it getting deleted).
Re:Running "n stable" removed bin, lib, share, include direc... by steve-howard on Monday October 08, 2012 @12:23AM (#4625492)
rm -rfi results in a lot of noise, and it becomes a habit to simply dismiss the warnings without reading them.
Re:Running "n stable" removed bin, lib, share, include direc... by mikebannister on Sunday October 07, 2012 @09:41PM (#4625147)
everything in my /usr/local is owned by my user. isn't this typical in the case of a dev machine?
Re:Running "n stable" removed bin, lib, share, include direc... by wtallis on Monday October 08, 2012 @02:16AM (#4625711)
If it's going to be owned by your non-root account, shouldn't it be installed to ~/? It seems like a bad idea for a non-root user to have control over binaries that are in root's $PATH.
Re:Running "n stable" removed bin, lib, share, include direc... by uxp on Monday October 08, 2012 @09:45AM (#4626781)
/usr/local on a normal, stock OS X install is completely unused. Homebrew's installer commandeers it by `chown`ing it to the current user and makes it group writable, as to cut down on the sudo noise. I think issues like this, and the fact that nearly all package managers, including aptitude, yum and ports require sudo should be catalysts for requiring sudo for updating and installation of packages. It's that whole security vs. convenience tradeoff again.

I've actually run into a similar issue with another installer via a Rakefile that lacked uninstalling capabilities and a confusing method of determining the $PREFIX which resulted in me shredding my /usr/local/bin directory for a couple seconds before my ^C spamming stopped the process.

Re:Running "n stable" removed bin, lib, share, include direc... by dagw on Monday October 08, 2012 @06:09AM (#4626178)
On a server or an environment where you don't trust your users, absolutely. On your own private dev machine that's only used by you, doing things the 'wrong' way is often perfectly acceptable and makes life easier.
Re:Running "n stable" removed bin, lib, share, include direc... by rhizome on Sunday October 07, 2012 @06:04PM (#4624596)
As far as the headline goes, not running any of this as root is a good start.
Re:Running "n stable" removed bin, lib, share, include direc... by benatkin on Sunday October 07, 2012 @07:32PM (#4624803)
That by itself is rarely a solution, especially these days. People store very important stuff in their home directories. It would need to be something like an isolated user account, a virtual machine, or a browser window.
Re:Running "n stable" removed bin, lib, share, include direc... by benatkin on Sunday October 07, 2012 @07:40PM (#4624820)
Ultimately the tree owners need to be bigger and have more resources devoted to them. The rails project routinely gets major bugs fixed in under a day.
Re:Running "n stable" removed bin, lib, share, include direc... by adgar2 on Sunday October 07, 2012 @07:31PM (#4624799)
> Except it can do also a lot of other bad things, and its too much to review. So in the end you trust the tree owner, and he blindly trust a zillion people.

> I actually have zero good solution to this, but it'll be interesting when it is used for a large attack.

The only solution is intelligence and prudence on the part of the tree owners. Large software systems need to ultimately be in the hands of smart and wise people. Unfortunately, that wasn't the case here.

Re:Running "n stable" removed bin, lib, share, include direc... by thirsteh on Sunday October 07, 2012 @08:13PM (#4624913)
Re:Running "n stable" removed bin, lib, share, include direc... by adgar2 on Sunday October 07, 2012 @08:17PM (#4624924)
Do you actually think Ken disagrees with me?

Hint: he doesn't. He wouldn't accept a line of code starting with "rm -rf $VAR" in ~30 minutes on a Sunday morning.

Re:Running "n stable" removed bin, lib, share, include direc... by thirsteh on Sunday October 07, 2012 @11:32PM (#4625405)
Try not to take offense from things so easily.

I linked Ken's paper because it's related. His conclusion is that it doesn't matter how smart the users or maintainers are if somebody wants to install a clever bug. Smart and clever people can still choose not to accept contributions from people they don't know.

Re:Running "n stable" removed bin, lib, share, include direc... by zobzu on Monday October 08, 2012 @09:23PM (#4629500)
basically they have to earn trust before they can do this i actually have some half solutions, that many use. one of these is code signing (digital signing or simple "signed off by" from an email that you believe belongs to the owner, even thus the first is stronger)

this means, the person may eventually do bad stuff, after earning your trust. OK. But if that's ever detected, at least you can trace back to him.

Re:Running "n stable" removed bin, lib, share, include direc... by benatkin on Sunday October 07, 2012 @07:35PM (#4624807)
> Large software systems need to ultimately be in the hands of smart and wise people. Unfortunately, that wasn't the case here.

Wow, it must be awesome to be you.

Re:Running "n stable" removed bin, lib, share, include direc... by adgar2 on Sunday October 07, 2012 @07:36PM (#4624812)
Didn't say I was one of them. Enjoy your strawman. Personally, I prefer a bit more flavor. Though your implicit ad-hominem tastes a bit juicy.

Writing a package manager is actually really serious business. This package manager runs under user credentials and is expected to modify the filesystem. You can't sandbox around those requirements. No amount of whinging avoids that. This story is one of many examples why you can't take it trivially.

If you're afraid to point out incompetence - and where it is most dangerous - you won't know it when you see it. And it will bite you, hard.

Re:Running "n stable" removed bin, lib, share, include direc... by grannyg00se on Sunday October 07, 2012 @07:56PM (#4624861)
I upvoted your response because on one hand I do think you are correct in all of what you are saying.

But your previous post can be interpreted as an implication that the people themselves are neither smart, nor wise. A somewhat harsh attack. I re-read it with more emphasis on the "here" part of the sentence and it sounded a bit more as though you are saying that in this instance the people were not wise.

Pointing out incompetence is helpful, but it's also very useful to do so in a way that attempts to minimize the chance of an extremely negative interpretation.

Re:Running "n stable" removed bin, lib, share, include direc... by adgar2 on Sunday October 07, 2012 @08:03PM (#4624883)
I expected an extremely negative interpretation. My criticism is harsh because the failure here was unacceptable.

Look at the pull request they merged in. Any line added to a script which starts with "rm -rf $VARIABLE" cannot be scrutinized enough.

The first commit was created at: 2012-09-30T10:25:44-07:00.

The pull request was accepted at: 2012-09-30T10:59:08-07:00.

34 minutes to accept on a Sunday morning. I suspect that wasn't 34 minutes of review. I suspect it was closer to 34 seconds of review.

Unacceptable.

Re:Running "n stable" removed bin, lib, share, include direc... by wtallis on Monday October 08, 2012 @02:12AM (#4625699)
If virus scanners were common on unices, their primary purpose would be to watch for the string "rm -rf".
Re:Running "n stable" removed bin, lib, share, include direc... by tjholowaychuk on Sunday October 07, 2012 @10:33PM (#4625254)
shit happens, and then you die. when you have 50+ people that just "+1" an issue for long enough without helping, you tend to limbo-merge
Re:Running "n stable" removed bin, lib, share, include direc... by adgar2 on Sunday October 07, 2012 @11:00PM (#4625324)
Engineers have responsibility.

Otherwise you're just throwing shit at a wall and seeing what sticks.

Re:Running "n stable" removed bin, lib, share, include direc... by aidenn0 on Sunday October 07, 2012 @11:14PM (#4625362)
Sounds like 99% of software development to me, OSS or otherwise.
Re:Running "n stable" removed bin, lib, share, include direc... by dasil003 on Monday October 08, 2012 @04:56AM (#4626039)
Obviously this was an epic fail deserving of your original derision, but I can't help but be struck by the irony in your complaint of ad-hominem after what you wrote.
Re:Running "n stable" removed bin, lib, share, include direc... by matthewowen on Monday October 08, 2012 @08:22AM (#4626503)
His comment wasn't an ad hominem. An ad hominem would be 'this person isn't smart and wise, so his decision's are wrong'. The poster's comment was of the following implicitt form:

* These sort of packages should be run by people who are smart and wise * The fact that this happened suggests that this person is not smart and wise * It is unfortunate that he is running a project used by many people.

It's perfectly valid to criticise a person (or a person's fitness for a responsibility) based on their actions. An ad hominem is the opposite - it is criticising a persons actions or arguments based on who the person is (rather than the actions or arguments themselves).

Re:Running "n stable" removed bin, lib, share, include direc... by emmelaich on Sunday October 07, 2012 @08:34PM (#4624979)
The change also has one of my pet hates: the -f flag to rm. It not only means force, it means ignore errors. If you're not interested in errors, why attempt to do it in the first place?
Re:Running "n stable" removed bin, lib, share, include direc... by benatkin on Sunday October 07, 2012 @10:10PM (#4625207)
git has done an excellent job of bringing this abuse into the 2010s. If you need to delete a local copy of a git repo, which is often only useful for a couple minutes while evaluating code, you have to do something to override the read only files git creates. Mercurial doesn't have this issue.
Re:Running "n stable" removed bin, lib, share, include direc... by cma on Sunday October 07, 2012 @11:15PM (#4625369)
chmod
Re:Running "n stable" removed bin, lib, share, include direc... by jlgreco on Monday October 08, 2012 @12:02AM (#4625461)
I think it is a great flag, if used with that functionality in mind. Useful reasons very similar to why the -p flag to mkdir is useful.
Re:Running "n stable" removed bin, lib, share, include direc... by Confusion on Monday October 08, 2012 @11:37AM (#4627327)
To remove stuff?