Live data from Hacker News

Dev corrupts NPM libs 'colors' and 'faker', breaking thousands of apps

bleepingcomputer.com

841–850 of 1001 posts

Re: Dev corrupts NPM libs 'colors' and 'faker', breaking thousands of apps

#841

Earlier quoted context omitted.

> Adding permissions is a reasonable step, but I don't think it solves the problem. We know, it's very hard to get granularity right with permission systems and there is a strong temptation to just give everything all permissions. A lot of that stems from permissions systems being implemented outside of the code they constrain. In theory a compiler knows every reachable system call and all points of data input that c…

> In theory a compiler knows every reachable system call and all points of data input that could reach them Sorta yes, sorta no. Imagine I'm making a chat client, and I want users to be able to drag and drop images to share. But the OS doesn't have an "open drag-and-dropped file, extension .png or .jpg" function call, it only has "open file" which lets me open ~/.ssh/id_rsa too. Or if I'm making a web browser and I w…

> But the OS doesn't have an "open drag-and-dropped file, extension .png or .jpg" function call, it only has "open file" which lets me open ~/.ssh/id_rsa too.

A programming language doesn't have to expose system calls directly. It arguably it shouldn't, in fact, for exactly this reason.

Re: Dev corrupts NPM libs 'colors' and 'faker', breaking thousands of apps

#842

Earlier quoted context omitted.

I don't think the OSS work around GNU, etc, can be directly compared to the "new" model around npm/gems/pip/etc, which has really only been going for a bit over 10 years. I can't put my finger on why they're different, but they definitely feel different. The big question is what happens when a maintainer wants to retire and a successor can't be found? Or (as in this case), when a maintainer gets so annoyed by their u…

The package ecosystem is growing and there’s more good packages each year. 10 years isn’t 30, but it’s still a long time to show success. That’s there’s only been a few problems like this despite millions of users is a sign of strength. I hedge by pinning yo specific versions and keeping my own package manager (RStudio) to keep mirrors if the packages I scan. That the packages are open source means they are easier to…

Success != sustainability.

If a thing has an expiry date that is >10 years, then you're not going to see any problems for 10 years. That doesn't mean the expiry date doesn't exist, or that the thing won't hit it. It can be wildly successful for all those years and then hit the expiry date and stop immediately.

Re: Dev corrupts NPM libs 'colors' and 'faker', breaking thousands of apps

#843
post #810

Earlier quoted context omitted.

How many other maintainers are getting increasingly annoyed at the users of their code? Entitled users demanding changes to fit their use cases, megacorps using the code for free, other megacorps forking the code and launching it as a commercial service, we've been hearing for years about the problems of being an OSS maintainer. Focusing on the troubles of this one person is a mistake. Of course the more "unbalanced"…

Every single cent earned in my career depends on OS software in one way or another. Maintaining a public repo or two can very well be considered part of your job, or purely for giving back something. I for one enjoy if anyone makes money with help of my code. I very well know I wouldn't have made it so far without many many others having chosen this way before.

I agree, but the number of people I know who could maintain a popular OSS lib for years is tiny. I certainly couldn't do it, nor would I want to; I don't have the right kind of personality for that job.

I'm happy to contribute code, or documentation, but that's not the same thing.

Re: Dev corrupts NPM libs 'colors' and 'faker', breaking thousands of apps

#844
While I disagree with his move.

1.It is totally in his prerogative to mess up the package he manages, but not to install into it malware. I am on the fence if this would count as malware. (Because of the open loop, but my leaning is that this is not malware.)

2. Github is, IMO, breaking any trust that I might have had by assuming control of the package, removing the last commit and keeping it online.

If they feel they have a reason to close it, they should. And, they then should fork it and put it up under their own name. Which would generate lots of bad press, but is at least within their rights.

3. I don't quite follow the logic of Github closing his account. Yes, I know that when you use $megacorp they WILL eventually close your account and make you sad. Google did it to me once and shut my gmail account. Tough luck for not being a millionaire.

4. You should always lock your NPM dependencies on a version, and update it when you can see what the results are.

5. Yes, the large corps really should be paying for all the work that is being done to help them, despite their hostile attitudes (being typed on a Mac. Guess who wrote the docs? Not Apple.)

6. Github has some perfectly good competitors, both SaaS (gitlab.com, sourcehut.org) and self-hosted (gitlab, gogs/gitea, etc)

Using them empowers you, and removes a wincy bit of leverage from $megacorp. Enough people follow suit, and the world will be a better place. And besides, Copilot won't steal or reveal your code.

7. There are more effective ways of making his point, but he worked out of emotion, not logic.

Eg. Perhaps he would have been able to change the license and demand compensation from all non-profits? That would provide both cash and publicity.

As a rule, it is always better to act out of logic than emotion, but us humans seem to have an issue with this. ;)

8. Is anyone stepping in to help the author get treatment?

Re: Dev corrupts NPM libs 'colors' and 'faker', breaking thousands of apps

#845

AITA for thinking that if you develop open-source software and your license permits anyone to use it for free, then complaining about no compensation is not a valid complaint? I totally understand that billionaire corporations use software like this for free. But the software maintainer has explicitly allowed _anyone_ to use it for free. If you don't want them to use it for free, license it as such. What am I not see…

Not sure if calling their complaints 'invalid' is really the most productive avenue here. They've maintained it for free, and have stopped doing so. I'd say their complaint they're not getting paid enough is about equally valid as the complaint that the software you've been using for free stops being maintained.

Re: Dev corrupts NPM libs 'colors' and 'faker', breaking thousands of apps

#846

Earlier quoted context omitted.

Sure, trying to find exactly where the malicious line gets crossed is pretty hard and subjective, and maybe that will bite GH one day. But this specific case is not anywhere near that line, the sole intent of those commits was to break others, and he admitted so himself. This is like arguing about whether the james webb telescope really is in space since we don't have a precise consensus about what altitude is consid…

I'm sure this case is clear, my point was around the wider principal that by going down this line GH set themselves up as arbiter of "malice" To take a trickier example, say a GH user has a lib, then decides to re-architect it, breaks the API and for their own purposes pushes it to an existing version, breaking all other use of it. Now that's a nasty thing to do, but is it malice? Another, real-world, example is I kn…

> By stepping into this area GH are going to have to find answers to this a

I think they already have, those 2 examples you mentioned already happened and were dealt with.

I think intent is important to take into consideration, since after all that is the definition of malicious: intent to cause harm.

Your first example clearly has no intent to cause harm. That case probably happened thousands of time already since not everyone is willing/able to follow semver cleanly and strictly. Never heard about GH taking any measure against that. And I would definitely not expect them to as a user/maintainer.

For the second case, I think GH policy is that you can host that kind of PoCs, but the repo has to be clearly documented as doing such (e.g. you can't just add some vuln into some unrelated code "for research"), and the vulnerability cannot be an active one: "We understand that the publication and distribution of proof of concept exploit code has educational and research value to the security community, and our goal is to balance that benefit with keeping the broader ecosystem safe. In accordance with our Acceptable Use Policies, GitHub disabled the gist following reports that it contains proof of concept code for a recently disclosed vulnerability that is being actively exploited." - GitHub." [1]

Back to Marak's case, my opinion is that GH did the right thing: If he just had his code in a repo, with no semver, no other contributors/maintainers, and such, and decides to nuke it, then I hope GH would not have done anything.

But when you are using all the tools and trust of open source: Other people contributing to your repo, other people being active maintainers/admins and spending times out of their days to fix bugs on it, when you leverage NPM to make it easier for you to distribute your package to others widly etc, you give up the privilege being able to act unilaterally like an asshole without consequences.

[1]: https://www.bleepingcomputer.com/news/security/githubs-new-p...

Re: Dev corrupts NPM libs 'colors' and 'faker', breaking thousands of apps

#847

Earlier quoted context omitted.

Not really, individual package developers don't have as much inmediate control over the repository's state as they do with NPM. Packages go through a review by one of the trusted developers and sometimes automated QA and testing (including as of late reproducibility testing, i.e. does the source match the binary?), before being uploaded to the repository. If you can't trust the team behind the distro, then sure, your…

I use Gentoo which uses portage the package manager and the way portage works is it pulls source then compiles. Source is rarely checked by everyone. Small packages exist as well. Many Linux distro simply barrow binaries from "trusted" sources. The entire eco system is really a deck of cards.

[deleted]

Re: Dev corrupts NPM libs 'colors' and 'faker', breaking thousands of apps

#848
post #277

Earlier quoted context omitted.

This is scary, and I don’t know why people here aren’t losing their minds. I think someone should make a big deal about this. What would be the first step? On the other hand, my GitHub was once suspended (and all repos shuttered) for posting gists that looked like spam to some algorithm. It was extremely unsettling, and they need to do a better job communicating. But they may have suspended the account because they t…

Why is that scary? If you do bad things, you're going to get banned. This guy abused Github to distribute malicious code to thousands of projects. If losing your Github means losing your projects, that's on you for being lazy/irresponsible with them. Git is already decentralized, and anything important should be cloned on something you own.

The counter-framing is this guy updated his project and thousands of projects chose to pull that update.

He didn't go around submitting PRs to update the version of this. He didn't deploy anything into production.

You have the right to use the code for free, and he has the right to do terrible things with his code. If you don't like that arrangement, get him to sign a contract that includes responsibilities on his part like not shipping intentionally broken packages. Or get your distribution from someone that does have a responsibility to you.

I probably wouldn't do the same in his position, but I still support his (moral) right to do what he did. It's his project, and he can tank it if he wants to. Just like if I had a business, I could tank it if I wanted to. It's probably not a wise thing to do, but it is something I could do.

Re: Dev corrupts NPM libs 'colors' and 'faker', breaking thousands of apps

#849

Here's my $.02: Packages are literally remote code exec vulns in the hands of package authors. At the very least, it takes them under a minute to break your app, simply by deleting their package. Read the article. This is not the first time it's happened, and it's not going to be the last. [0] I write backends (mostly in PHP, although not exclusively), and I release a lot of my code under libre licenses. But I don't…

How complicated it is to just clone the repo and point your apps to your forked version? That way this would not have happened.

Re: Dev corrupts NPM libs 'colors' and 'faker', breaking thousands of apps

#850
post #455

Maintainer of Chalk[0][1] here, a very popular alternative to colors. Happy to help anyone that would like to port away from colors to chalk, or who might just have general questions about terminal colors. Just reply here and I'll see them. [0] https://GitHub.com/chalk/chalk [1] https://npmjs.org/package/chalk

No post body was provided.
Post reply on HN