News for hackers. Stuff that matters.
Re:What NPM should do to stop a new colors attack by spankalee on Monday January 10, 2022 @07:48PM (#29885507)
Just because the package owner had implicit permission to run code on other people's machines, doesn't mean that this wasn't an attack.

A postal carrier may have a key to a building to deliver mail, but if they use it to turn on all the faucets and leave the doors open, it's an attack.

Re:What NPM should do to stop a new colors attack by alar44 on Tuesday January 11, 2022 @01:46AM (#29888379)
That's exactly backwards. He wasn't granted permission to run code on other people's machines, he granted other people the right to run his code on their machines!

Wow!

Re:What NPM should do to stop a new colors attack by stickfigure on Tuesday January 11, 2022 @01:53AM (#29888415)
There is a social contract in the world of open source. The author violated it.

If he exploited trust to steal private crypto keys, we'd have no trouble calling it an attack. The difference is merely a matter of degree.

Re:What NPM should do to stop a new colors attack by zepolen on Tuesday January 11, 2022 @02:51AM (#29888752)
> There is a social contract in the world of open source.

No there isn't. What there is however is the actual contract of the repo (MIT License):

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Listen, open source is about freedom, and the author is perfectly within his rights to freely change HIS OWN REPO as he wishes. Just as anyone is within his rights to freely FORK THE REPO.

This is open source.

Re:What NPM should do to stop a new colors attack by arcticbull on Tuesday January 11, 2022 @03:14AM (#29888898)
> This is open source.

No, it's not.

The idea that you can waive the implied warranty of fitness for a particular purpose covers good faith mistakes or omissions. It doesn't cover intentional misrepresentations or excuse blatant fraud and criminality. For instance, if you sneak in a ransomware package, it's not "all good folks" because "there's no warranty, it's my repo and you can munch on my nuggets."

The author offered something to the community on certain terms and made certain representations. The author then decided that they had sellers remorse, and instead of acting like a professional adult who realized they made a poor investment (and finding a new maintainer), they threw a tantrum and decided to try and stick it to "the man" by violating the representations they previously made to the community as a whole.

This was petty, petulant and in bad faith. Does it rise to the level of criminality? It might, IANAL though. Nobody's going to go after them because it was more immature than truly harmful.

Re:What NPM should do to stop a new colors attack by krageon on Tuesday January 11, 2022 @07:32AM (#29890748)
Perhaps it would help if you took a step back and realised you are demanding something from someone who volunteered to let you have some of their work with no guarantee other than that you'd get the work.

There was a time where we'd say "yes, this is cool. I'll use it" and we moved on. Now you can't publish something online without an army making frankly toxic demands on your time because they feel there is something wrong with what you made.

The attitude you are displaying right now is the one that birthed CoCs and the various other straitjackets that we use these days because folks have lost the ability to tell a toxic community to go jump in a lake when they make demands they shouldn't. And it is a shame, because the permissive and open climate is what makes open source: If you don't like it, you fix it.

Re:What NPM should do to stop a new colors attack by arcticbull on Tuesday January 11, 2022 @03:33PM (#29897421)
> Now you can't publish something online without an army making frankly toxic demands on your time because they feel there is something wrong with what you made.

Asking you not to intentionally break a package you know 20,000+ products rely on as a result of your representations hardly seems like a toxic demand on their time. They hadn't committed to the project in over three years. All they had to do was continue not committing to it.

Asking them to find a new maintainer or not intentionally wreck other people's work that relies on it isn't a toxic demand, it's asking for a modicum of respect.

I'm not saying you have to keep building sandcastles, im saying if you decide to stop for whatever reason its not a toxic demand to ask you not to knock over 20,000 other sandcastles on your way out - out of spite.

This feels like a clear case of stupid games -> stupid prizes.

Re:What NPM should do to stop a new colors attack by zepolen on Tuesday January 11, 2022 @05:21PM (#29899009)
That analogy needs rephrasing, the OP built a sandcastle and left instructions on how to build it which 20,000 other people used to build (their own) sandcastles.

Then the OP decided to make a new change for his own castle.

"Draw a vulgar expression on the front door."

Which 20,000 people blindly copied and then have the audacity to complain about.

Re:What NPM should do to stop a new colors attack by arcticbull on Tuesday January 11, 2022 @07:59PM (#29900908)
It's not audacity to use a piece of software in the way it was made available on the terms under which it was made available. What is audacious is simply rugging everyone that took you at your word.

[edit] To be honest you're not even advocating for a coherent model of open source software. Should everybody consuming every library fork it in case the author throws a tantrum? That hardly seems workable. The author didn't just stomp on big company sandcastles, the author knocked over everyone's. Every pet project, every startup getting off the ground.

For what? Sellers remorse. Author wrote something and gave it away, then regretted giving it away. Sorry.

Re:What NPM should do to stop a new colors attack by zepolen on Tuesday January 11, 2022 @11:27PM (#29902296)
> Should everybody consuming every library fork it in case the author throws a tantrum?

Yes you should always fork open source projects critical to your project that are not mirrored somewhere safe, you never know when they may be inadvertently deleted, that's just common sense.

For dependencies, simply pin your versions and put library upgrades through a code review, that way no unknown code enters your system. Or just wait a couple days after a new release, the shit will hit the fan from all the incompetents.

> That hardly seems workable

Right, no one wants to do the work.

> For what? Sellers remorse. Author wrote something and gave it away, then regretted giving it away. Sorry.

For what? Buyers remorse. You blindly pulled code without looking at it, then regretted pulling it. Sorry.

Re:What NPM should do to stop a new colors attack by arcticbull on Tuesday January 11, 2022 @11:56PM (#29902506)
> For dependencies, simply pin your versions and put library upgrades through a code review, that way no unknown code enters your system.

These are all solid recommendations but don't excuse shit behavior on behalf of certain poor participants in the ecosystem. Which it seems you're super eager to do for some reason.

> Right, no one wants to do the work.

I mean so far it looks like one guy lol.

> For what? Buyers remorse. You blindly pulled code without looking at it, then regretted pulling it. Sorry.

We're talking about this guy's motivations not that of the consumers.

Re:What NPM should do to stop a new colors attack by zepolen on Thursday January 13, 2022 @02:10AM (#29917721)
> don't excuse shit behavior on behalf of certain poor participants in the ecosystem

Why not? You are excusing the incompetence of everyone affected by this.

Re:What NPM should do to stop a new colors attack by ethanwillis on Tuesday January 11, 2022 @03:39AM (#29889037)
It's not a ransomware package and drawing upon metaphors like this is poor reasoning. I suggest you read some Dijkstra on this idea of "medieval thinking."
Re:What NPM should do to stop a new colors attack by arcticbull on Tuesday January 11, 2022 @03:40AM (#29889046)
[edit] The point I was making is not that the author committed a ransomware package (or even that it is a good analogy) but that the idea there is a blanket waiver of warranties that covers whatever you wish it to by virtue that it is yours is trivially falsifiable.
Re:What NPM should do to stop a new colors attack by ethanwillis on Tuesday January 11, 2022 @03:42AM (#29889057)
Sorry, I can't continue a good faith argument with someone who defines this as malware. It's delusional.

I won't edit my comment above except to note what the original parent comment was:

" The author committed malware to a package many relied on, that they had not made a commit to in 3 years. My point is not that the author committed a ransomware package but that the idea there is a blanket waiver of warranties that covers whatever you wish it to is trivially falsifiable."

Re:What NPM should do to stop a new colors attack by arcticbull on Tuesday January 11, 2022 @03:45AM (#29889072)
You are correct that calling it malware is borderline - it was malicious software designed to cause harm or nuisance (to some degree) for users. However, I have amended my comment to for clarity of intent.

The definition of malware for the record is:

  ...  software that is specifically designed to disrupt, damage, or gain unauthorized access to a computer system.
Seems close to me, the modifications were designed to disrupt the users of this package. This is not strictly relevant.
Re:What NPM should do to stop a new colors attack by ethanwillis on Tuesday January 11, 2022 @03:51AM (#29889106)
All I want to say is that if accepting your argument as 100% true, then corporations have done much worse with software end users have actually PAID for. Yet, this same community that holds this developer of software that is free is held to a higher standard they don't apply to their own commercial projects.
Re:What NPM should do to stop a new colors attack by arcticbull on Tuesday January 11, 2022 @04:00AM (#29889163)
Out of curiosity do you have some examples where customers paid for a library, and then the author of that library decided they disliked the terms of the arrangement and injected some code to make it non-functional demanding nebulous payment? Or worse?

I suspect not, because they would be sued into the dirt for breech of contract and shortly find themselves out of business. In fact I believe the customers could even sue for specific performance and force the seller to actually execute the contract as committed.

It's not that I hold free software to a higher standard, I hold folks to the standard they committed to. The author had big sellers remorse, upset that they had offered this software free of charge. I'm sorry, we all make decisions we regret. If they didn't want to maintain it anymore they could have found a new maintainer. Instead they decided to mess with the computers of people who accepted their representations.

Re:What NPM should do to stop a new colors attack by ethanwillis on Tuesday January 11, 2022 @04:19AM (#29889283)
Sure, How about Google borking a user's device with OTA updates and then telling users to go pound dirt with their silence?

https://9to5google.com/2015/04/10/nexus-5-nexus-7-bricked-an...

Re:What NPM should do to stop a new colors attack by arcticbull on Tuesday January 11, 2022 @04:33AM (#29889385)
That appears to be (a) unintentional, which is a critical distinction (b) 7 years ago and (c) if the comments section is to be believed, resolved by calling Google up, explaining the situation and receiving a complementary warranty extension.

  To their credit they stood behind it. Mine was repaired, FREE (October 2015)
The delay was, more than likely, simply that big companies move slow. This is not the same thing.
Re:What NPM should do to stop a new colors attack by ethanwillis on Tuesday January 11, 2022 @12:34PM (#29894669)
Point A is a simplification. Point B is irrelevant. If you think it's bad it doesn't matter when it's done. Or will you say that in a few years what you think is bad that this developer has done is no longer bad? This is flawed reasoning. Point C you're sugar coating it. He initially was denied and given the run around and only after making a sufficient fuss was he deemed worthy of a warranty extension. How many others weren't? It's the same thing in american healthcare where insurance companies will "Accidentally" deny coverage a few times for certain things just to get the less persistent people to give in and not bother fighting for what they're owed.

But here's the real context on Point A since you don't want to actually look into it further and most outlets aren't going to bother doing it either. Once Google realized what was happening, well, it kept happening. They were pushing these OTA updates in some cases with 0 user intervention. Not to mention you're taking the comments out of order. That specific commenter had his device bricked multiple times. Why don't you quote that part of his dialogue?

Maybe you should ask why devices would be bricked in the same way multiple times?

Re:What NPM should do to stop a new colors attack by arcticbull on Tuesday January 11, 2022 @03:27PM (#29897351)
I'm sorry but there's no comparison between mishandling a bug causing an issue for customers unintentionally, and intentionally nuking all your customers from orbit with a malicious commit because you threw a temper tantrum. There's a ton of good ways to handle this. Find a new owner, for instance.
Re:What NPM should do to stop a new colors attack by dse1982 on Tuesday January 11, 2022 @08:45AM (#29891364)
Re:What NPM should do to stop a new colors attack by hansvm on Tuesday January 11, 2022 @08:36AM (#29891281)
It happens all the time.

Some anecdata: When Garmin bought Navionics they cancelled everyone's paid lifetime licenses, pushed updates demanding logins (worse in this case than others because 99% of the places you'd use their software have shitty internet, so an intermittent login wall is a bit crippling even if it were free) and monthly subscriptions, and hounded every negative review saying that they were doing it for the users' own good. Could a person sue for $19.99 and not have corporate lawyers juggle you between headquarters in Kansas and Italy? Maybe, but it's a pain in the ass for minimal gains.

Re:What NPM should do to stop a new colors attack by zepolen on Tuesday January 11, 2022 @03:24AM (#29888957)
You should have been on the internet a couple decades ago, you'd have hated it (and we'd all have laughed at you.)
Re:What NPM should do to stop a new colors attack by 1_player on Tuesday January 11, 2022 @05:15AM (#29889635)
I don't think you remember how the internet was 20 years ago very well to make a statement like that.
Re:What NPM should do to stop a new colors attack by arcticbull on Tuesday January 11, 2022 @03:36AM (#29889022)
Thankfully, most of the community has matured in the interceding decades.
Re:What NPM should do to stop a new colors attack by zepolen on Tuesday January 11, 2022 @04:11AM (#29889225)
Actually, most of the community no longer spends their time here, but of course you wouldn't know about that, you are not invited.
Re:What NPM should do to stop a new colors attack by arcticbull on Tuesday January 11, 2022 @04:36AM (#29889399)
If it's a community of folks who release open source projects, see their success, then throw tantrums I mean, that doesn't sound like a loss to me. I'm happy that y'all were able to build a community on common foundations and I wish you the best of luck!
Re:What NPM should do to stop a new colors attack by Kavelach on Tuesday January 11, 2022 @03:14AM (#29888904)
At first, I upovted zepolen's comment about there being no social contract, only license, but something bugged me about that, and I felt that I wasn't right.

After thinking about it for a while, I think that you are right, there is an implicit social contract when using open source software, and a part of this contract would be to expect the maintaining people to provide the best quality software they can create.

But the thing about contracts is that they work between multiple parties, and not just the maintainer(s) and some void. And consumers of the library didn't do their due diligence, that is, supporting the code that they rely on.

Re:What NPM should do to stop a new colors attack by ethanwillis on Tuesday January 11, 2022 @03:33AM (#29889003)
Best quality in what regard and to whom? Software in its purest form is for self expression which is exactly what he is doing. He never explicitly intended this software for commercial usage. And in a non-commercial setting his changes aren't even close to being deemed harmful.
Re:What NPM should do to stop a new colors attack by BoorishBears on Tuesday January 11, 2022 @11:07AM (#29893208)
> And in a non-commercial setting his changes aren't even close to being deemed harmful

So you don't even know what happened?

There's an infinite loop after it finishes printing garbage. It's an unquestionably harmful change.

Also, you know how you prevent non-commercial use?

https://github.com/Marak/colors.js/blob/master/LICENSE

-

I don't get it, Marak is clearly having some sort of episode*, and people are bending over backwards to rationalize the result as if there's some clear connection between his intent and his actions.

How many people realize he made those anti-commercial comments two years ago. Right now it actually seems like his comments were more political than financial.

* I don't mean that in a backhanded way, based on his history and his recent comments I think this is someone who needs help regardless of his actions on NPM*

Re:What NPM should do to stop a new colors attack by kderbyma on Tuesday January 11, 2022 @01:45PM (#29895803)
it's art. I like the idea of occasionally writing to my fans....:D
Re:What NPM should do to stop a new colors attack by rak1507 on Tuesday January 11, 2022 @03:44AM (#29889069)
lol do you actually think people care about providing the 'best quality software they can create' https://www.npmjs.com/package/is-even etc
[dead]
Re:What NPM should do to stop a new colors attack by stickfigure on Tuesday January 11, 2022 @06:28AM (#29890128)
I live in a world in which you get banned from Github, NPM, and possibly other communities for violating that "imaginary" social contract.
Re:What NPM should do to stop a new colors attack by rakoo on Tuesday January 11, 2022 @07:05AM (#29890518)
All centralized platforms, with the inherent issues that have been analyzed for decades already. Continuing to use them and complaining of those issues doesn't make any sense at this point.
Re:What NPM should do to stop a new colors attack by stickfigure on Tuesday January 11, 2022 @10:08AM (#29892289)
Who is complaining? I'm glad this guy got booted out of these (relatively) high-trust societies.
Re:What NPM should do to stop a new colors attack by alar44 on Tuesday January 11, 2022 @02:12AM (#29888518)
Merely a matter of degree? There is a chasm between stealing data and printing nonsense to stdout.

That's like saying getting all your limbs cut off is technically a flesh wound and the only difference between that and a papercut is the degree of the wound.

Re:What NPM should do to stop a new colors attack by irfanka on Tuesday January 11, 2022 @04:46AM (#29889455)
Well... yes. That's exactly what "degree" means.
Re:What NPM should do to stop a new colors attack by krageon on Tuesday January 11, 2022 @07:29AM (#29890711)
Yes, but you wouldn't use it in this manner in a good-faith conversation.
Re:What NPM should do to stop a new colors attack by krageon on Tuesday January 11, 2022 @07:28AM (#29890709)
> There is a social contract

No. You use what they wrote because they allowed you to. It is not then their responsibility what you do with it or how things inconvenience you. It is up to the user to vendor the dependencies and make sure everything works the way it should.

> The difference is merely a matter of degree.

In the same way that using your front door to break someone's nose on purpose and someone skinning their knee on an unfortunately placed step in your garden is different degrees of assault, sure (i.e. it's not and the only way in which it is is pedantic and not useful).

Re:What NPM should do to stop a new colors attack by Macha on Tuesday January 11, 2022 @01:59PM (#29896046)
> No. You use what they wrote because they allowed you to. It is not then their responsibility what you do with it or how things inconvenience you. It is up to the user to vendor the dependencies and make sure everything works the way it should.

There is also no obligation for you to use or distribute newer versions, even if you are NPM.

Re:What NPM should do to stop a new colors attack by ratg13 on Tuesday January 11, 2022 @02:07AM (#29888489)
This still leaves the elephant in the room: who decides when this line has been crossed?
Re:What NPM should do to stop a new colors attack by thirtyseven on Tuesday January 11, 2022 @04:12AM (#29889237)
I think the organizations that spend tons of money to run the central repositories we all use are a good candidate for that.
Re:What NPM should do to stop a new colors attack by rakoo on Tuesday January 11, 2022 @07:34AM (#29890765)
I would have said it's the organization that earn tons of money and don't give a cent to developers if they can avoid it who should think about the structure they have created and profited from and now realize open source doesn't exist in abundance like air.
Re:What NPM should do to stop a new colors attack by toxik on Tuesday January 11, 2022 @03:08AM (#29888861)
Intent is what matters, was it meant as an attack - and it kind of was but Joe Developer Schmoe really just got caught in the crossfire of some guy who watched Mr. Robot one time too many.

To answer your question directly, I think the jury’s still out and it will depend on the repercussions. So far it seems to have been a nuisance at worst.

Re:What NPM should do to stop a new colors attack by jzb on Monday January 10, 2022 @08:36PM (#29885975)
He didn’t, though. People signed up to a distribution method to run the code and just assumed future updates would be okay. He didn’t push the code to them, they pulled it.
Re:What NPM should do to stop a new colors attack by PragmaticPulp on Monday January 10, 2022 @10:08PM (#29886896)
People didn't actively go seek out a new version.

He intentionally abused semver to disguise it as a safe update, when it was not.

I know it's popular in programming/infosec to blame the victim for trusting anyone, but you can't deny that this it's common behavior among many (though not all) projects to use the caret prefix when specifying dependencies because you trust the package maintainer to honor the semver agreement.

Re:What NPM should do to stop a new colors attack by shepherdjerred on Monday January 10, 2022 @10:52PM (#29887306)
It's his project. It's a free, open-source project. What does the maintainer owe us? Absolutely nothing.

> I know it's popular in programming/infosec to blame the victim for trusting anyone, but you can't deny that this it's common behavior among many (though not all) projects to use the caret prefix when specifying dependencies because you trust the package maintainer to honor the semver agreement.

Be thankful that all he did was spam the console. It could have been something more malicious. Updating dependencies without auditing source code is a very common practice, but that doesn't mean it's not the victim's fault. It is unrealistic to audit the insane amount of source that our projects are built on, but that is the exact tradeoff that we're making in exchange for the productivity of not building libraries ourselves or paying for those libraries.

Open source is something that we're gifted not something that we're owed. If you disagree, then feel free to either use exclusively proprietary software where you can have expectations of the maintainer, or build all of the functionality that you need by yourself.

Re:What NPM should do to stop a new colors attack by afiori on Tuesday January 11, 2022 @03:38AM (#29889035)
I think that open source developers still owe us not to maliciously run malware on our machines.

To be clear they do not owe us to produce good code, or to keep producing code, or to produce the code we want; it is remarkably close to charity giving: the developer/mantainer is donating their work/code to the community.

Just like charity you should not give poisoned gifts.

The kid that gave homeless people oreos with toothpaste filling wasn't charitably offering food to someone in need, he was maliciously offering them a "poisoned" gift.

Re:What NPM should do to stop a new colors attack by rakoo on Tuesday January 11, 2022 @07:12AM (#29890576)
Open source developers don't owe anyone anything. It's this entitlement that has led so many of our fellow people in the community all the way to depression. Stop expecting something when it was explicitly stated that software is provided with no guarantees.
Re:What NPM should do to stop a new colors attack by afiori on Tuesday January 11, 2022 @08:52AM (#29891419)
My point is different: People owe everyone not to maliciously inject malware on their machine, it is irrelevant whether you are an open source developer or not.

The author published the packages to a public registry with the expectation that the code would be run by others, it was not just a random github project, it literally invited others to run the code by being registered on npm.

The author explicitely offered no warranty on the code, but distributing malware is both illegal and against npm ToS.

Being an open source developer does not put you above ethics.

The only thing that would change this would be if some third party was mirroring their code on npm without the author consent.

Re:What NPM should do to stop a new colors attack by oauea on Tuesday January 11, 2022 @09:00AM (#29891511)
If you choose to download my code and include it in your project and it doesn't do what you expect, that is on you.

The colors library has an infinite loop and you shipped that version to your end users? That's on you. Test and pin your dependencies. Not doing so is the true offense. Be upset with AWS and the likes who will run unvetted third party code on your machine.

Also note that an infinite loop is not malware. Implying such is insane. Are you now going to call every piece of crashing software malware?

Re:What NPM should do to stop a new colors attack by fault1 on Tuesday January 11, 2022 @11:30AM (#29893637)
People are going to include the code in question mostly via transitive dependencies. Creating an app with create-react-app will lead to at least 2000+ such dependencies. That's just how the entire npm ecosystem works, and so there is certain community wide expectations not to do this sort of thing, and when it does happen, have mechanisms in place to contain the damage. I agree that people should reassess their exposure to such a ecosystem but that is besides the point.

I believe this is akin to not driving dangerously on the road. There is obviously a social contract. This what living in a society is all about. Just because someone can do something doesn't mean we can't expect otherwise.

His work benefited from the work of many other people who also released open source software. That not only includes the packages that he released, of which he had other contributors, some of which actually wrote more of the package than he did (colors.js) as well as packages that he more or less did a direct port from (faker.rb and CPAN::faker). He also benefited from the entire npm/node ecosystem.

People have every right to be pissed.

Re:What NPM should do to stop a new colors attack by afiori on Tuesday January 11, 2022 @10:43AM (#29892818)
> If you choose to download my code and include it in your project and it doesn't do what you expect, that is on you.

Completely agree.

But the key concept that keep avoing is malicious intent.

Let's make an analogy in a completely different topic: Are (D)DoS attacks wrong? do people owe us not to (D)Dos our machines?

On one hand we connected our machines to the internet and declared ourself as ready to accept incoming traffic; on the other hand spinning up a bot army to render said machines unsusable is not nice.

Is it correct to say that you should have some kind of (D)DoS pretection on your services? yes. Is it also correct to say that people should refrain from crapping on other people stuff? also yes.

Getting back on topic; there is possibly a solid case to argue that this was not criminal (as no unauthorized "access" happened) but as much as open source volunteers should be more appreciated the "don't intentionally damage stuff with the SOLE intent of damaging stuff" is something expected of any human regardless of their social position.

Re:What NPM should do to stop a new colors attack by oauea on Tuesday January 11, 2022 @11:28AM (#29893603)
> Are (D)DoS attacks wrong?

Yes, if you attack infrastructure that you do not have permission to test. Here people downloaded code, ran it on their own infrastructure (or worse: shipped it to their users!) and were surprised this code did not do what they expected.

So, the only malicious actors here are those who shipped the package to their end users. Not the developer, they did not ship the code to anyone. They simply released a new version that other people chose to download and include in their own work.

To be clear, it's a total dick move and I don't support it at all, but the real blame should go to those who blindly download such code and run or redistribute it.

Re:What NPM should do to stop a new colors attack by shepherdjerred on Tuesday January 11, 2022 @01:38PM (#29895685)
I totally agree.

We need better tools to prevent things like this from happening again because nobody is ever going to audit the 2000 dependencies of every new create-react-app release.

Re:What NPM should do to stop a new colors attack by shepherdjerred on Tuesday January 11, 2022 @01:41PM (#29895749)
> I think that open source developers still owe us not to maliciously run malware on our machines.

The open source developer didn't run anything on your machine. You ran it on your machine. The developer published code. Others blindly pulled the update, and that propagated.

Re:What NPM should do to stop a new colors attack by sakarisson on Tuesday January 11, 2022 @03:05AM (#29888840)
> Be thankful that all he did was spam the console.

Why would I be thankful for that?

If you slap me, should I be thankful that my nose wasn't broken?

Re:What NPM should do to stop a new colors attack by jzb on Tuesday January 11, 2022 @10:30AM (#29892610)
If nothing else, he illustrated a point that many people needed made. They got off cheap - he didn't exfiltrate data, install malware or whatever. He showed that their supply chain is insecure, and that they are trusting way too much in the kindness of unpaid strangers.

If your business or development practices depend on pulling a bunch of packages from NPM or other sources un-audited and so forth - especially straight into production! - you need to seriously rethink things. You got off relatively light, this time, if you were impacted by this.

Re:What NPM should do to stop a new colors attack by baq on Tuesday January 11, 2022 @03:26AM (#29888973)
Fool me once… etc.
Re:What NPM should do to stop a new colors attack by alex_sf on Monday January 10, 2022 @11:30PM (#29887559)
> People didn't actively go seek out a new version.

When they set their dependency versions to 'latest', that's exactly what they are doing.

Re:What NPM should do to stop a new colors attack by fault1 on Tuesday January 11, 2022 @02:07AM (#29888486)
however, I think the more common case is that they set it to the latest bounded by a minor or patch version (as opposed to a major version) as defined by semvar.

at least that seems to be quite common in the npm/js world.

Re:What NPM should do to stop a new colors attack by oauea on Tuesday January 11, 2022 @08:57AM (#29891485)
> People didn't actively go seek out a new version.

They did. They chose not to pin their dependency versions, so this is their clear explicit choice. They also chose not to test their dependency updates before pushing it through to their end users, pure negligence by e.g. AWS who was affected by this.

Re:What NPM should do to stop a new colors attack by rakoo on Tuesday January 11, 2022 @07:15AM (#29890599)
> People didn't actively go seek out a new version.

Yes, they did. Have you read the article ? That's how npm works: it always pulls the latest version.

You can't use tools you don't understand and blame someone else if it doesn't work as you expect it to.

Re:What NPM should do to stop a new colors attack by PragmaticPulp on Tuesday January 11, 2022 @11:26AM (#29893562)
> Yes, they did. Have you read the article ? That's how npm works: it always pulls the latest version.

No, it pulls the specified version.

The affected packages fixed it by removing the leading carpet in the version specifier, which was designed to allow patch version bumps for things like security fixes.

He literally abused the versioning system designed to allow security fixes by introducing a breakage and disguising it as a non-breaking change.

Re:What NPM should do to stop a new colors attack by tasha0663 on Monday January 10, 2022 @10:09PM (#29886914)
There's a thread on the "zalgo" issue on GitHub where he's being a jerk. And he has a sizeable past history of jerkdom. Don't blame the victims that the well was poisoned, blame the jerk who poisoned it.

Do I really think he's a jerk? No, I think he's unwell. Previous headlines, lots of conspiracy theory posting recently, now this. He needs help.

Do I think this is an attack? We call other exploits attacks. The shoe fits. This was a deliberately hostile act.

Re:What NPM should do to stop a new colors attack by brigandish on Tuesday January 11, 2022 @12:54AM (#29888092)
> Don't blame the victims that the well was poisoned, blame the jerk who poisoned it.

Why are they drinking from someone else's well? Someone with "a sizeable past history of jerkdom"?

If you can check the water - nay, if you can copy the water and check it, and create an identical well from that water so that said jerk may never interfere with it again - then the "victims" have no one to blame but themselves.

If he had poisoned other people's wells you might have a point. He didn't, in the same way that poisoning the water I keep in my fridge is not an attack on anyone else. Why do you trust the water in my fridge without checking it?

Re:What NPM should do to stop a new colors attack by anhner on Tuesday January 11, 2022 @07:08AM (#29890541)
> Why are they drinking from someone else's well?

Because the well said "free water". And in some cases it's not even them taking water from that well, but other people who they asked to bring them tea (third party libraries).

> Someone with "a sizeable past history of jerkdom"?

Do you really dig through the internet history of every maintainer of every package you ever used?

Re:What NPM should do to stop a new colors attack by brigandish on Tuesday January 11, 2022 @08:41AM (#29891318)
> Do you really dig through the internet history of every maintainer of every package you ever used?

No, because that would be impossible but I do try to check the libraries I use to the best of my ability, the same with browser extensions I install. I even read the ingredients on things I buy. Sometimes I read the instructions on drugs I'm prescribed.

The perfect is the enemy of the good, after all.

Re:What NPM should do to stop a new colors attack by krab on Tuesday January 11, 2022 @08:19AM (#29891121)
In fact, it said "free water without implied fitness for a particular purpose".
Re:What NPM should do to stop a new colors attack by lolinder on Monday January 10, 2022 @08:39PM (#29886000)
He did what he did knowing full well that people would end up downloading and running that code. By your same reasoning you could argue that websites distributing malware aren't pushing viruses to people, people are coming to them and pulling the virus onto their computer.
Re:What NPM should do to stop a new colors attack by hackmiester on Tuesday January 11, 2022 @02:10AM (#29888504)
Microsoft may have the right to host and distribute this person’s code, but if they use it to take over the package and make decisions on the author’s behalf, it’s an attack.
Re:What NPM should do to stop a new colors attack by kristjansson on Monday January 10, 2022 @11:08PM (#29887406)
A package isnt even implicit authorization to run arbitrary code on other peoples machines. It’s authorization to run a specific, known version of your code, preferably one that others are also using without incident.

That’s the whole point of TFA: this is a design flaw in NPM, a package author shouldn’t be able to have the impact this event did, regardless of how popular their package is.

Re:What NPM should do to stop a new colors attack by xvector on Monday January 10, 2022 @08:06PM (#29885676)
It's still his project. He could have deleted it for all I care, it's his every right.

I wonder if GitHub/NPM even have the legal rights to modify the code you publish, depending on your license.

Re:What NPM should do to stop a new colors attack by lolinder on Monday January 10, 2022 @08:42PM (#29886022)
Deleting it would have been less offensive because deleting it would simply have caused his code to stop executing on other people's machines altogether. What he did instead was execute malicious code (albeit a relatively benign malice) on the computers of people who previously trusted him.

Deleting the package is within his rights. Modifying the package to be abusive may technically (legally) be within his rights but is certainly not ethical, and I'm not even convinced that it was legal. Had he modified the package to install a Bitcoin miner instead of just breaking apps, I suspect he'd be breaking the law, and it's not obvious to me that a DOS attack should be treated differently.

Re:What NPM should do to stop a new colors attack by xvector on Monday January 10, 2022 @08:57PM (#29886215)
> Modifying the package to be abusive may technically (legally) be within his rights but is certainly not ethical

Of course it's not ethical. But, publishing whatever code he wants under his name, under his projects, is well within his rights.

We are setting the precedent that users can modify the code you've published under your own name, if they don't like what you've done with it.

That is not acceptable. My users should not have hegemony over my project. They can decide to fork, they can decide not to use it. But under no circumstances should they be able to edit my project under my name.

Because that's also unethical.

> I'm not even convinced that it was legal. Had he modified the package to install a Bitcoin miner instead of just breaking apps, I suspect he'd be breaking the law.

I really doubt this. People are choosing to run his code, and choosing to update to whatever new code he publishes, regardless of the contents.

It's not like he's forcefully installing his code on anyone's machine. By enabling automatic updates of his package, developers have implicitly granted him permission to run whatever he would like on their machine.

Unethical, sure. But perfectly legal.

Re:What NPM should do to stop a new colors attack by e1g on Monday January 10, 2022 @09:23PM (#29886491)
Most people had no idea they even use colors.js as it’s used by some dependency of some dependency. For example, anyone installing AWS CDK afresh would be unable to deploy their infrastructure - it uses colors.js, which blocks the CPU as soon as it’s require’d deep in the stack. With that rug pull, the library author intended, designed, and successfully accomplished a Denial of Service move against all those people.
Re:What NPM should do to stop a new colors attack by brigandish on Tuesday January 11, 2022 @01:04AM (#29888139)
> Most people had no idea they even use colors.js

Why is that? Do NPM package managers not create a lock file that is a text file anyone can peruse?

Re:What NPM should do to stop a new colors attack by fault1 on Tuesday January 11, 2022 @02:10AM (#29888501)
yeah, it's just nobody reads every package in that file.

apps generated via create-react-app have more than 2000+ transitive dependencies.

Re:What NPM should do to stop a new colors attack by syshum on Tuesday January 11, 2022 @03:29AM (#29888990)
That is a design problem of npm and really the nodejs dev community in general.

They (you) are Blaming the dev because inherent design flaws in their development methodology.

People have been pointing out this problem with npm for years and years

Re:What NPM should do to stop a new colors attack by krab on Tuesday January 11, 2022 @08:25AM (#29891182)
> Most people had no idea they even use colors.js

Isn't that the problem? That they were running a lot of code from unpaid contributors without any guarantees (as said explicitly in the license) and then blaming those contributors when something breaks?

Re:What NPM should do to stop a new colors attack by lolinder on Tuesday January 11, 2022 @09:32AM (#29891811)
Yes, it's a huge problem. But the author here is absolutely at fault for this attack.

If I leave my garage door wide open all night and a bunch of stuff gets stolen, I'll kick myself for stupidity and vow not to do it again. I'll also call the police and hope they find the perpetrator, because there was a theft.

It is true that we as a profession need to drastically rethink our approach to dependencies and also that this author acted unprofessionally and should be condemned for his actions.

Re:What NPM should do to stop a new colors attack by xvector on Tuesday January 11, 2022 @01:20PM (#29895424)
> If I leave my garage door wide open all night and a bunch of stuff gets stolen

It's more like, "I let some random guy do whatever he wants to my garage door and he decides to brick it."

Re:What NPM should do to stop a new colors attack by lolinder on Monday January 10, 2022 @09:03PM (#29886278)
> We are setting the precedent that users can modify the code you've published under your own name, if they don't like what you've done with it.

Not users of your code, platforms you distribute on, and that precedent has been rolling forward for a while now, it's not new. Even so, I don't approve of GitHub's ban, but that doesn't mean I have to endorse the author.

> People are choosing to run his code, and choosing to update to whatever new code he publishes, regardless of the contents.

This line of reasoning would suggest that the authors of malware that requires affirmative action to start running (download an exe, open a PDF, whatever) are clean and clear legally because the victim chose to run their code. How is this any different than a malicious EXE sitting on a server somewhere waiting to be downloaded? It can't just be that the victims in this case ought to have known better, because the victims in most cases of malware ought to have known better.

Re:What NPM should do to stop a new colors attack by brigandish on Tuesday January 11, 2022 @01:06AM (#29888151)
> are clean and clear legally because the victim chose to run their code

If you take a knife from my kitchen and use it on yourself that is not my fault.

If you ask me for a tissue and I provide you with a knife and tell you it's a tissue, then I have some responsibility.

Ultimately, in either case, why were you not more careful?

Re:What NPM should do to stop a new colors attack by vertis on Tuesday January 11, 2022 @08:40AM (#29891312)
I mean to strain the analogy it's more like feeding someone a sandwich and then having the ability to transmute the sandwich into a knife once they've already eaten it.
Re:What NPM should do to stop a new colors attack by brigandish on Tuesday January 11, 2022 @08:44AM (#29891350)
Did he meta-program that infinite loop? I haven't bothered to read the code… like everyone else :-D
Re:What NPM should do to stop a new colors attack by syshum on Tuesday January 11, 2022 @03:35AM (#29889014)
For me the question is was the new (breaking) functionality announced when the package was updated. It appears to me it was thus I find no issue.

This is different then software announcing on the next release they will include ads or even a crypto miner as part of revenue generation

As long as the change is announced then there is no ethical issues and if you as the dev or user fail to read the updates of your depencacy tree well that is a failing on your part

Re:What NPM should do to stop a new colors attack by arcticbull on Tuesday January 11, 2022 @04:20AM (#29889294)
> I really doubt this. People are choosing to run his code, and choosing to update to whatever new code he publishes, regardless of the contents.

Not sure that's true. The fraudulent element there would be the clear and intentional misrepresentation. If the package were represented as a Bitcoin miner, that's one thing. However, representing it as color and styling for your terminal and then mining with it, that seems illegal. Would love a lawyer to weigh in.

Re:What NPM should do to stop a new colors attack by spankalee on Monday January 10, 2022 @10:18PM (#29887003)
> We are setting the precedent that users can modify the code you've published under your own name, if they don't like what you've done with it.

Who has done this? Can you point to it?

Re:What NPM should do to stop a new colors attack by sam0x17 on Monday January 10, 2022 @09:12PM (#29886365)
The correct approach would be to allow changes like this to be pushed to _new_ versions but to lock pre-existing versions in place. The alternative is this weird world where the platforms themselves have spooky editorial control over every package and could step in at any time and lock out the maintainers (sounds a lot like SourceForge).
Re:What NPM should do to stop a new colors attack by kijin on Monday January 10, 2022 @10:57PM (#29887337)
The "alternative" is exactly what Linux distros like RHEL and Debian do. They have editorial control over every package and often make changes the original developers don't like. It seems to work fairly well as long as you don't insist on following the latest version.
Re:What NPM should do to stop a new colors attack by seoaeu on Tuesday January 11, 2022 @12:27AM (#29887933)
One mental model is that Linux distros are really just curated package repositories, with all the upsides and drawbacks that come with that. Especially regarding their dogmatic insistence that across the entire repository there's only a single (or at most several) versions of any given library
Re:What NPM should do to stop a new colors attack by prmoustache on Tuesday January 11, 2022 @07:55AM (#29890934)
Aren't developers always using the same version and blindly downloading and running malicious code doing the same thing, running a single version?

Only those were harmed. And by harmed it was just really a bunch of tests runs failing, I guess no production workload was impacted by that jerk move.

Re:What NPM should do to stop a new colors attack by sam0x17 on Friday January 14, 2022 @12:13PM (#29937110)
Right, but my point is this code, in and of itself, really isn't malicious. It's only malicious in the context of "version XYZ used to do X, now it does Y". If you make versions indelible, you eliminate the potential for this to blow up as an issue.
Re:What NPM should do to stop a new colors attack by zkldi on Tuesday January 11, 2022 @12:52AM (#29888074)
To be clear, you can't edit an existing published version of a package on NPM, nor can you delete packages (havent been able to for 5 years-ish).
Re:What NPM should do to stop a new colors attack by sam0x17 on Monday January 10, 2022 @09:15PM (#29886395)
> Modifying the package to be abusive may technically (legally) be within his rights but is certainly not ethical

Sorry to play devil's advocate here, but who are you to say that the future vision of faker isn't some text being sent repeatedly to the console? One man's feature is another man's DoS attack, and while it's clear here, there are plenty of scenarios just like this where there is no obvious solution. We should just let maintainers do what they want with packages (other than install viruses or crypto-miners), but we shouldn't let them pull or modify old versions. Otherwise everything becomes like SourceForge where the platform itself can "editorially" decide to take over projects for financial gain whenever they feel like it and that behavior becomes normalized.

Re:What NPM should do to stop a new colors attack by naikrovek on Monday January 10, 2022 @08:41PM (#29886017)
is it his right? to sabotage downstream code in revenge for not being paid for work he willingly took on knowing full well that he may never be paid?

legality is defined at the behest of societal needs. if society says something legal should be made illegal, or vice versa, then it will be.

GitHub/Microsoft chose to do the right thing for the society in the short term. in the long term, choosing a less stupid library update policy will benefit everyone AND let authors do all the "non-harmful" malevolent stuff they want.

as if this wasn't a single-point denial of service attack...

we are slowly (far too slowly) learning that our assumptions that all developers are benevolent is incorrect, and it's going to take another 2-5 instances of this kind of attack before people really start to understand why and see the danger of simply using libraries at all; especially in ecosystems like NPM where almost no one writes a single line of code on their own if it can instead be pulled in as a library dependency. this attitude is the exact opposite of a secure code approach and until people learn this, and learn it well, this kind of attack will continue, and the time between the attacks will gradually shorten.

Re:What NPM should do to stop a new colors attack by heavyset_go on Monday January 10, 2022 @09:17PM (#29886421)
> to sabotage downstream code in revenge for not being paid for work he willingly took on knowing full well that he may never be paid?

Some consumers of his project chose to use his 3rd party dependency in their code for free knowing full well that it could disappear or break at any time, and yet they still chose not to mitigate those risks they chose to take on.

Re:What NPM should do to stop a new colors attack by naikrovek on Monday January 10, 2022 @10:42PM (#29887211)
yes, that is the other half of the coin: don't run code if you don't know what it does.

an extreme version of that: don't use libraries at all.

I am trending more and more to this extreme as I age, because people aren't learning their lesson, and the npm ecosystem keeps biting them over and over...

Re:What NPM should do to stop a new colors attack by chaostheory on Monday January 10, 2022 @09:25PM (#29886511)
"we are slowly (far too slowly) learning that our assumptions that all developers are benevolent is incorrect, and it's going to take another 2-5 instances of this kind of attack before people really start to understand why and see the danger of simply using libraries at all"

I agree, but at the same time if we had this mindset earlier; open source probably wouldn't have caught on as quickly. Maybe it wouldn't have become mainstream?

Re:What NPM should do to stop a new colors attack by seoaeu on Tuesday January 11, 2022 @12:29AM (#29887946)
Honestly, it is kind of surprising we've gotten this far assuming that basically all open source maintainers aren't malicious
Re:What NPM should do to stop a new colors attack by raesene9 on Tuesday January 11, 2022 @03:26AM (#29888974)
Unfortunately I don't think that 2-5 instances of this will produce any change.

We've seen more than that number of actual malicious package takeovers in the last couple of years and it has produced basically no real change.

heck I did a talk describing this kind of attack 6 years ago and I found prior instances when researching that talk...

Re:What NPM should do to stop a new colors attack by xvector on Monday January 10, 2022 @08:52PM (#29886155)
Should your users have control over the code you publish under your name?

Because that is the precedent we are setting here.

Re:What NPM should do to stop a new colors attack by fault1 on Monday January 10, 2022 @11:14PM (#29887454)
Did he own this code? Colors.js had plenty of other contributors, and there was no CLA involved.

github user "DABH" actually had more lines of code than marak did: https://github.com/Marak/colors.js/graphs/contributors

npm and github both have terms of service that you agree to when you choose to distribute something over those systems. npm in particular has had a long policy of unrolling malicious changes to the registry of packages ever since left-pad.

Re:What NPM should do to stop a new colors attack by yifanl on Tuesday January 11, 2022 @05:26AM (#29889710)
If the responsibility lies with the maintainer, then the responsibility lies with the maintainer.
Re:What NPM should do to stop a new colors attack by Too on Tuesday January 11, 2022 @01:41AM (#29888352)
It’s not just a random personal repo on GitHub. It has a long documentation published on NPM describing the intention of the module. It is advertised as being something it now clearly and deliberately is not.

Some would even call it a genuine fraud. Doesn’t matter if you paid for it or not, there are plenty of free services in meatspace that can be compared. Free quote of bathroom renovation - plumber changes all your locks when you look away while doing the inspection.

Now should consumers be more careful about situations like this, yes. Can this guy expect to claim any rights after a move like this, no.

Re:What NPM should do to stop a new colors attack by spankalee on Monday January 10, 2022 @09:38PM (#29886638)
Why are you bringing up modifying his code? I haven't seen any indication that anyone did that.

Changing the metadata around a npm-stored package is something that npm should have every right to do. Same for changing the metadata about a GitHub project. Neither the npm registry entry nor the GitHub project settings are the copyrighted code.

Re:What NPM should do to stop a new colors attack by saghm on Monday January 10, 2022 @08:27PM (#29885890)
I mean, for almost every mainstream open source license, the answer to that is a pretty definitive "yes, they can", right? The most stringent of them require things like attribution and open source the modifications, neither of which seem like requirements that Github/NPM would have any qualms with following.
Re:What NPM should do to stop a new colors attack by xvector on Monday January 10, 2022 @08:53PM (#29886164)
But does GitHub/NPM have the right to modify his code and publish it under his account/his name? I doubt that is legal.
Re:What NPM should do to stop a new colors attack by jffry on Monday January 10, 2022 @09:29PM (#29886552)
The MIT license doesn't require NPM to list marak as the publisher of the NPM package, as long as they still obey the license's requirements.

Besides, the NPM Terms of Service are almost certainly broad enough to permit NPM to publish a modified version of a package or to delete a package.

Re:What NPM should do to stop a new colors attack by ratg13 on Tuesday January 11, 2022 @02:25AM (#29888601)
And all of the contributors to his code?

What if he had done nothing more than create the repo and the community did all of the legwork? Is it still his right to delete all of their work?

Re:What NPM should do to stop a new colors attack by xvector on Tuesday January 11, 2022 @02:29AM (#29888626)
Yes, it's his repo after all. If I let you grow flowers in my garden, it's still my right to burn it all down.

Otherwise, a multi-owner org should be used, or we need new concepts (like changes to repositories signed by multiple contributors.)

Re:What NPM should do to stop a new colors attack by fault1 on Tuesday January 11, 2022 @02:55AM (#29888775)
But with contributors, it's literally not his to "own", in terms of the actual work. Copyright law says roughly that you own the characters you type, unless you assign it to someone else.

The guy who actually wrote more of colors.js (by lines of code) than marak actually got npm to nuke the offending releases: https://github.com/Marak/colors.js/issues/317

right now they are reviewing a request to change the npm target to his repo

Re:What NPM should do to stop a new colors attack by prmoustache on Tuesday January 11, 2022 @08:33AM (#29891249)
To write and merge code to Marak's version DABH has its own copy so your question makes no sense.

Marak could decide to make his repo disappear it doesn't make the local or hosted repos of other contributors disappear. It seems that github managed to distort your mind into thinking that git was no longer a decentralized cvs.

Re:What NPM should do to stop a new colors attack by fault1 on Tuesday January 11, 2022 @11:38AM (#29893808)
I don't get your point.

The repo, gh/npm accounts and such are just metadata and metadata of metadata, which is hosted and distributed based on the terms of service of gh/npm. The thing that matters most is what the npm project points to, since it is relied on by other packages and apps.

The only thing this guy "owns", according to the law, is the copyright for the part of the codebase he wrote. Not that it matters much since it is MIT licensed.

Re:What NPM should do to stop a new colors attack by prmoustache on Thursday January 13, 2022 @05:50AM (#29919272)
> The thing that matters most is what the npm project points to, since it is relied on by other packages and apps.

And it doesn't really matter that much because the NPM people can decide to make it point somewhere else wherever they want, or people can decide to create a new package name on NPM and use that new name on their package.json file.