Then in the original project you can say “the last version of this project is N.N; here are some possible candidate successor forks, which have not been vetted”.
This way no one who is merely keeping up with version numbers will accidentally step off of a reasonably good package on to a fraudulent package.
To prescribe some preventative advice based on this: it's probably not a good idea if your project gets popular to continue being a solo developer in open source. So plan ahead based on your popularity.
And your project isn't likely to explode in popularity over-night and be a dependency for 1000+ other projects, so you should be able to see this coming.
Of course, this is super-easy to prescribe in hindsight.
They are practicing resume driven development. While this is unpaid, it's not completely altruistic.
I wrote about it, discussing my motivations for open source:
B. Really like the elegant style (visually, though the writing is also elegant!) of your blog.
Seems there is a bit of a "boys will be boys" phenomenon going on.
Edit: Clarified second sentence.
I'm not placing all the blame on the original maintainer as I understand his philosophy of handing off the torch, but I think it's a naive thing to do, as this has shown.
Ultimately, this has been a good demonstration of a weakness with the ecosystem and I think there are a lot of things that could be improved here to help mitigate this in the future.
No, this thread didn't happen because a bunch of developed chose to make this a conversation about responsibility more than fault. They're mad they got suckered and Dominic is the best scapegoat.
Responsibility can fall on multiple people. I don't understand why everyone looks at things in such a binary way. Responsibility, fault, etc. are not binary things. Two or more people responsible for one problem can be both upset at each other perfectly justifiably.
In this case, every developer has authority over their own code base. If I decide to include some random code from the internet in my project then I am responsible for that decision. If whoever has commit privileges on that random code decides to commit malicious code, then they have responsibility for that. However, that doesn't make them responsible for my project, because they have no authority over my project.
Including a dependency in a project is a security vulnerability. It may be worth the risk, it may not, but it is definitely a risk. And responsibility for taking that risk is entirely on the person who took the decision to include that dependency.
This may be a moot point if you consider that "full damage" can be more than what one person can be expected to take responsibility for and handle.
To mitigate the risk they have these options:
1 - Don't use the software.
2 - Audit the software themselves before they use it.
3 - Pay someone to do the auditing for them.
Even if they choose options 2 or 3, there's still a chance the some vulnerability of malware could sneak through (especially if they're getting a binary blob or source code written in a language like C that makes obfuscation easy).
But if they choose to use unaudited software, they're playing with fire and shouldn't be surprised if from time to time they get burnt.
4) Use an OSS dependency checker tool that reports the risk in your dependency tree
4a) Dependency tool uses a crowdsourced database of audit/review metrics
A typical NodeJS project has potentially 1,000's of (transitive) dependencies. Many well-established projects use dependencies versioned e.g. 0.0.1 etc.
I guess there are hundreds of similarly unmaintained packages among these.
Lacking 4) a small-time developer working on a side-project only has option 1) (or option 0 - Take the risk) as a feasible way to go.
denial, anger, bargaining, depression and acceptance.
^^^^^This conflation is definitely a bad thing. Words with an actual meaning get over-used, simplified, stripped of their original meaning, and then merged. It would be 100% to the detriment of our language if it happens in this case.
Open source does not mean free (as in freedom or beer), free (as in beer) does not mean open source. Free as in freedom almost always means open source.
Side rant: Also, open source doesn't mean "open to contributions". Giving access to the source code does not mean obligation to accept contributions to said source.
How true, this is such a common misunderstanding among newcomers to FOSS, it can't be repeated enough times.
I think several decades of Open Source boosterism may have eventually given some people the wrong idea about what it's all about. Two annoying trends I've noticed in the last 10 years:
(1) (what this poor guy seems to be running into) People treating Open Source as anything other than charity from the people who put it out there. The people who make it generally don't owe anyone anything, including the people who use their code. I sometimes see very harsh criticism from people within the community that assumes anyone putting anything out there has to accept all sorts of responsibilities: maintaining a community, keeping on top of bug reports, acting as an integrator for people who want to send in patches, making sure that all packaging and documentation conform to some very high bar and/or specification, etc. Just because somebody puts something out there doesn't mean it has to be a second job for them, and doesn't mean that they are obligated to do anything for anyone, including responding to emails or dealing with bug reports or patches. It's perfectly fine to stop maintaining something after a while, or to just throw code over the wall and never touch it again after it's out there.
(2) (not this case) People treating Open Source as some avenue to professional fame or an eventual source of income. Yeah, that can happen, but it very rarely happens, and it's not a good reason to write it in the first place. This is the result of too many people using business arguments as a fundamental justification for doing Open Source, and people saying stuff like they only hire people who have projects on Github, and only if they like what they see. If someone's primary motivation is fame or money, Open Source is a terrible way to accomplish that. It's possible, just highly unlikely, plus I think it's much less likely to happen if that's someone's goal from the outset.
Many of these things which are distributed as packages are actually code snippets. They could be maintained in the form of a Stack Overflow answer to copy-paste into your code. The question-answer system exposes the code to the necessary competitive evaluation: a malicious answer soon gets downvoted. When the packaging metaphor is laden over them, the whole chain of responsibility lapses back to the vendor-consumer model. And this works when packages are large and take pains to reduce their own dependencies, even if it means common functions get duplicated across different packages.
But prolific authors currently are rewarded by being vendors of undersized packages: they enjoy large download numbers, Github stars, and so on. Without any kind of curation to impose friction on this process, they can do the wrong thing for a very long period and get zero feedback indicating that their actions create a problem. And on the consuming side nobody pays a lick of attention when the prompt says it's going to install 50 things with cute-but-opaque names. If they are under a page of code each, you could probably just print the code.
When I create projects now, I tend to grab some packaged code to start with, but apart from a few to do core functions like I/O I will treat them as placeholders and seek ways of reworking the code to make myself the sole maintainer. The alternative is to be a software consumer and to complain like a consumer - i.e. in a largely powerless fashion - when other people's code doesn't do what I want.
A more mature project will have a 4-figure number of dependencies.
Things like Node Security Platform (which was absorbed by NPM) exist for a reason. There's no reason for every person to vet every single package they use -- it'd be an awful lot of duplicated energy.
If there was no implicit trust in the community, and we had to act as vigilant as you describe, there would be no community.
Open source licenses state this clearly: "THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND"
Since no one seems to care about the freedom aspect of it, maybe we could rename it to "fee software" - give it away for free and encourage everyone to contribute with time and money. Will people stop being selfish because we changed the name? I don't think so.
> I've shared publish rights with other people before. Of course, If I had realized they had a malicious intent I wouldn't have, but at the time it looked like someone who was actually trying to help me.
Can anyone cite perhaps a handful of examples where this malicious open source usage ultimately bit them?
Then it was, clearly, negligent of him to give it to this person. He gave a stranger the power to do things in his name.
He doesn't have to maintain the project forever - it seems like a much easier solution is: don't give away a project with your name on it to someone you don't know. Instead, encourage them to fork and release a new version under their own name. This is a surefire way to never have an exploit spread to thousands of people with your name on it.
He didn't give anybody the power to do things in his name. He gave a stranger the power to contribute to a shared codebase. He never claimed to be a BDFL of this codebase. Your vitriol would be much better aimed at node modules which depended on non-fixed code which they didn't audit.
It is unquestionably better than your users, whose trust you've earned over time, suddenly finding that their app is mining cryptocurrency.
>He didn't give anybody the power to do things in his name.
His name is still on the project he gave away access to, so yes, he did.
>Your vitriol would be much better aimed at...
I think criticism is warranted here, but I don't think I've been especially vitriolic about it. Frankly, OP made a poor choice and is now making excuses by complaining about not being rewarded for maintaining the project rather than own up to it. There was a better way to do this without him having to perpetually maintain the project.
And moreover, the herd of commenters here on HN are projecting their dissatisfaction with entitled open source users onto anyone who criticizes OP.
As far as I'm concerned all of this "he should have" stuff is more proof that he's right: maintaining a popular open-source package for free can be no fun at all.
1. Dead project
2. You share access to lots of people and they act responsibly
3. You share access to lots of people and they act irresponsibly
#2 is waaaay more likely than #3.
Still seems to me like people are blaming the wrong person here. If you're writing a cryptocurrency-related module (the target of this specific attack) and you're using npm modules written by somebody you don't know, what the hell are you doing?
it absolutely isn't. The original author is a real person, with a twitter account, with a profile photo, with videos of talking at conferences. I accepted the code in my project because such author wouldn't get away with injecting the code with a backdoor. But a random alias that quietly takes over a package I didn't even know was abandoned because the author was too lazy to write "This package is no longer maintained" in the readme? That didn't give me any chance...
└─┬ [email protected]
├─┬ [email protected]
│ └── [email protected]
├── [email protected]
├─┬ [email protected]
│ ├── [email protected] deduped
│ └── [email protected] deduped
└─┬ [email protected]
├── [email protected] deduped
└── [email protected] dedupedIf one is writing something as security-critical as a Bitcoin wallet, then not using React (and other things with a similarly wide attack surface) is indeed the best you can do. Security is not tolerant of half-assed measures.
Seriously, some of the comments blew my mind. Because he built it, he had a responsibility to maintain it forever, and was responsible for everything that happened with that code forever?
Maybe calling free software "Open Source" was a mistake. If something is "free", then you have to accept you may get what you paid for. If you are using somebody else's code, is it their responsibility to look after it years after they have moved on, or your responsibility to make sure it's not full of bugs or malicious code.