Live data from Hacker News

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

bleepingcomputer.com

451–460 of 1001 posts

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

#451

GitHub has now suspended the maintainer: https://nitter.net/marak/status/1479200803948830724

If that is true it's an outrageous overreaction by GH. Are they now gatekeeping the kinds of code changes you can make to your own repo?

Why do you think you can use Microsoft's infrastructure to damage Microsoft's customers without consequences from Microsoft?

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

#452

I don’t understand the mindset of open source developers who dedicate significant time energy and life to free software, unless there’s a tangible, quantifiable advantage to doing so. That advantage may well be indirect such as reputational or learning. I just don’t grasp why people do it for nothing, to the advantage of large companies.

Because it's fun ya mook. That's it. That's the reason. It's fun to tinker. It's fun to put things out there into the ether. It's fun to exercise the brain and try new things and learn new ways to do things and publish things. The second it stops being fun, we stop.

I’ve realized the idea that the “Hacker” part of “Hacker News” is no longer here, and just a nod to some ancient, possibly apocryphal, past.

Discussions now are about how you shouldn’t run your own server, and you should use popular stuff so you can speed up development and get your startup going.

I mean, I know about ycombinator and all. But it doesn’t seem to truly encompass the hacker spirit, if you ask me.

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

#453

It's time for someone to make a Redhat, but for "safe" open source software libraries. My big enterprise would sign up for it in a heartbeat. We'd pay for access from an alternative NPM registry where everything is at least semi-vetted - someone at least looks at diffs before new versions get updated and made available. Sure, the "safe" repo wouldn't have as nearly as many packages as the main NPM repo, but if it had…

Use a language where you don't need to pull in 100 dependencies to create a useful application/service.

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

#454

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…

There are people who think its reasonable to take all the pennies from the "take a penny leave a penny" plate because "that's what it's there for."

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

#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

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

#456

Earlier quoted context omitted.

I don't understand why. It's his code to break if he wants. But I guess when you use a social media service to host your code these are expected and normal results.

> It's his code to break if he wants > I don't understand why If he can break his code because he is the owner then shouldn't the same reasoning apply for Github suspending the account?. It is their website and their rules. Keep in mind Github owns npm and the author has published a malicious package to npm which has 20 millions of downloads so I'm not surprised.

For some reason, people are adopting the ideologically inconsistent position full property rights to the dev, but no property rights to Github.

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

#457

The software industry doesn't have any standards about how to publish or consume software, and that leads to problems like these (not the conflict over OSS, but the ability for random upstream software to randomly compromise thousands of other projects). We all live in this 'wild wild west' of software that has no guarantees of quality or safety or rigor. We could really use a regulated license for software developme…

> The software industry doesn't have any standards about how to publish or consume software, and that leads to problems like these (not the conflict over OSS, but the ability for random upstream software to randomly compromise thousands of other projects). The publishing side is irrelevant. Anybody can make any package available for free on the internet. The unwillingness of some private businesses, often billion dol…

Why do you think we have zoning codes for how to build buildings? It's not solely because people refused to pay for buildings to be built the right way. Building things the right way takes longer and is more difficult, so people just didn't do it until they were forced to. The money is a red herring.

Businesses don't really use open source to cut costs. Most businesses don't even know they're using open source. The business hires engineers and tells them what they want built, and the engineers choose to use open source, because they're lazy and it's quicker than trying to get proprietary vendors approved and licensing costs included in budget forecasts. Maybe some tiny companies that have no money really need to use FOSS, but the majority of businesses pay for software when they need to, they don't mind.

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

#458
post #101

Earlier quoted context omitted.

A key difference with Maven projects is that you specify exact dependency versions instead of “always use latest” or some variant of that, as is pretty common in the Node world.

This is not necessarily true, there are version ranges: https://www.baeldung.com/maven-dependency-latest-version Admittedly, I don't think it has nearly as wide a usage as it has in the NPM world. Dependabot (I know I'm not the first to mention it, here, today) is probably more of a factor. Still , it strikes me that this sort of "attack" (or mishap) is exceedingly rare in the Java ecosystem, while it's pretty common…

We abuse jitpack.io and MASTER-snapshot to keep out Minecraft maven builds up to date.

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

#459
post #153

Earlier quoted context omitted.

How about using dependencies but pinning the version and only updating if you know what the update contains? I'm still continually baffled that we ended up in a world where automatically accepting updates from every dev and their dog is not just the norm but recommended practice.

> if you know what the update contains? I think anyone who thinks they're doing this is fooling themselves. You can review code for accidental vulnerabilities but if someone is trying to slip in a backdoor it shouldn't be hard to do so in a stealthy manner. The reality is that the entire dependency concept is just broken. There is an implicit trust that all dependencies are equally trusted. Your logging package is ju…

Permissions inside a programs own code seems incredibly difficult without radical change.

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

#460
post #221

Earlier quoted context omitted.

The tool should take some blame here. I agree that it’s ultimately the developers fault for allowing code to be automatically injected from not fully trusted sources on minor updates, but the package manager makes it way too easy to do. For example, when I npm install a package, it defaults to specifying a semver compatible version in package.json, rather than doing the secure thing and pinning a version. But whether…

> it defaults to specifying a semver compatible version in package.json, rather than doing the secure thing and pinning a version Note that if you have a package-lock.json (which you will by default), it will prevent any surprise updates even within the semver range specified. You have to manually run `npm update` to get the latest versions that match your semver. Personally I think this is the best middle-ground.

This is, unfortunately, not true by default. I had a case where I did `yarn install` and there were updates installed.

To make this work correctly, you need to do `yarn install --frozen-lock-file` or `npm ci`.

It’s absolutely _insane_ that this is the case. Gemfile.lock, Cargo.lock, and every other lock file format that I have used in packaging does this correctly.

Post reply on HN