124 points · by ramesh31 · 4y ago · 241 comments
"political activists" is 1) plural (wasn't it only 1 committer?) and 2) an opinionated label for someone we don't know much about. Sure, the commit may be an act of political activism, but to label the individual based on this one action seems inappropriate.
And "compromised" makes it sound like it's against the will of the maintainers. Do we know that? The commit was 23 days ago. There's an ongoing open discussion here where there are folks defending both sides: https://github.com/Yaffle/EventSource/issues/202
Anyway, a better title might be "event-source-polyfill displays popup about Ukraine in Russian timezones" or if its malware, then "event-source-polyfill affected by malware in Russian timezones"
Sabotage is a better word since it is not loaded politically. It does not infer a reason nor motive. Just that something happened which was deliberately done by someone.
Like I said sabotage isn’t loaded and does not depend on the motive. Only that something was disrupted on purpose.
> destructive or obstructive action carried on by a civilian or enemy agent to hinder a nation's war effort
Using this reasoning you could argue that any negative comments about the war towards a russian could be construed as sabotage, because it goes against Russian war-propaganda.
In comparison this act is probably more disruptive then anti-war sticker bombing in grocery stores (https://t.me/nowarmetro/465) and most people would call that sabotage.
But like I said, sabotage is not loaded. It can cause anything from a minor or trivial disruption, to a major destruction. It can have a positive or negative message, or even no message at all.
To some, that's malware, whilst to some people in Russia, it could be valuable information, something helpful.
But maybe most software people know about Tor and VPNs already. And I suppose that the popup in most cases got stopped during Q/A.
I don't really see the message reaching its intended audience
You can't win here. If you trust someone else's software, you need to evaluate the author and establish a relationship. For decades in open source, we did this via formal organizations with charters and incorporations and foundations and boards and stuff (FSF, Red Hat, yada, yada). We can trust gcc or Linux because we have visibility into the reward structure that produced it beyond "what this developer did".
NPM's big failing is in short-circuiting that process and inviting a culture where any rando can push out a package that can be trivially slurped up and used by everyone, transitively. That's great for the rando developers, not so great for the consumers as it turns out.
But you don't fix it via mob justice. You fix it via organization.
It's just documentation.
How will your list safeguard against this?
This is one of the more bizarre proposals I’ve seen entertained on HN.
Where is the line?
If I commit a political dissertation in the comments or README? If I change all my unit tests to use political phrases? If I name all my functions with political connotations? If I pass extra politically motivated data back with every response?
And how long does your name stay on the list? Any way to get it removed faster? Any way that it gets extended?
And this is in response to using free software?
We already have mechanisms for dealing with poor OSS decisions: raise an issue, fork it, unstar it.
Maybe we should focus on building up the better OSS projects than trying to create a blacklist of maintainers that don’t adhere to some standards they never agreed to, but we imposed on them.
OR we could use MUCH less resources and just make a sanction list.
I think that a sanction list would make sense, perhaps https://socket.dev/ could use it as a data point for alerts if they are not already
The GDPR does not have the ability to mandate my personal behavior, and even if it thought it did, many of us turn out not to live in Europe.
What are they going to do, prevent my text file from doing business in France?
"Its just a package for X" until its not.
I checked out a small project recently and it had over 2000 nom packages as dependencies. The culture around node development was/is just too dependency happy.
I get standing on the shoulders of giants and that not all people are bad, but with thousands of dependencies, the chances of a supply chain issue starts to become significant.
However I don't think the number of dependencies is a useful number: node was one of the first languages to have a build in standard way to get and manage dependencies, which meant that dependencies could be much, much smaller. Boost for C++ is a giant project, so you can say that your C++ project only has a few dependencies, but if C++ had a decent standard dependency manager, projects like Boost were probably split up more.
* I am aware Maven exists for Java, but the cultural expectations for Java were set long before it became a thing.
CPAN? Pip in python? Pear for php?
incorrect, try again please.
[1] https://access.redhat.com/security/vulnerabilities/RHSB-2022...
No more random-source. And no more "automatically pull from master, then build & deploy".
Inside a walled garden / from specific people you trust should be fine. Some automated scanning could maybe be ok-ish at least sometimes.
Granted, it's possible these commits are from people outside Ukraine, in which case, I wouldn't give them a pass.
If you want trust, use a (Linux) distribution as intermediary.
OSS is used not because it's safe or secure, but because the benefits outweigh the costs.
Correction: NPM packages are routinely hacked.
I've been using linux packages for two decades, and not once have they been hacked (to my knowledge). I consider those packages to be infinity more secure than proprietary packages where I and others can't check what's running under the hood.
OSS being safe and secure is one of the primary reasons why I prefer open source to closed source software.
There are deeper issues with NPM: how many developers review or audit any packages they download anymore cause each time they pull a single package, it comes with 3000+ dependencies? I'm being hyperbolic, but "open source" isn't the issue here.
What certification are you even talking about if developers themselves can't be bothered to audit their 3000+ NPM dependencies at first place? It's too much work cause too much dependencies? Well that's the architecture NPM chose. I don't have that issue with Go, PHP or Java package management oddly...
I mean do you hang out in your kitchen hoping that Bezos will come by your house to borrow a cup of sugar?
Donate money, take in a refugee, if you're so inclined go fight on the frontlines but this kind of theater is only done because people want personal attention.
> is going to exclude that person from participating in other software projects
It's not targeted at developers. It targets end users. It shows a browser dialog containing the author's message if the timezone is set to a Russian city.
> isn't telling anyone anything they haven't heard yet
It's not trying to inform you. It's trying to inform Russian citizens by sharing an onion link to the BBC website so they could have access to uncensored information.
> is only done because people want personal attention
It's probably done because the author is Russian. It's stated in the author's GitHub profile.
Put in onto social media, your website, your disclaimer, code comments, code license etc.
But never in the functionality of your code.
Virtue signalling will be the death of us. Wanting to look like you're doing something is winning more than actually doing something.
But fortunately, we live in a society where speech has an effect. Speech (which you derisively refer to as 'virtue signaling') shifts the Overton window, and influences the direction society goes.
It's ironic that you mention this, because the Overton window has been shifted so far to the left, I don't even think it's on the wall anymore.
Censorship is _rampant_ around the world. I'm glad you think it's all roses and daisies out there, but you have no idea how naive your perspective is.
I barely never see anything about other package indexes (crates.io, PyPI, etc).
Doesn't npm also use a lock file by default for packages?
First, the scale of the JavaScript ecosystem. JavaScript is so much larger than every other ecosystem, so even a very small probability event (somebody introducing malware into a package) can happen surprisingly often given the scale of the ecosystem. Supply chain attacks are a problem in all open source ecosystems – not just JS – but they are a bit rarer and don't effect as many people so fewer people take note.
Second, npm was one of the first package managers to solve the classic "dependency hell" problem. In Python, if you have two dependencies, A and B, which both depend on different versions of C, say C@1.0.0 and C@2.0.0, respectively, then you're in trouble. You have an broken project. Python can only install one version of C. So now you're in dependency hell.
Npm on the other hand just installs both versions of C and it gives A the version that it wants, C@1.0.0. And it gives B the version that it wants, C@2.0.0. Both packages are happy - problem solved.
This caused Python maintainers to think twice before adding a new dependency lest they cause "dependency hell" for their users. Much better to just copy paste these 50 lines of code rather than adding a dependency. So there was an intrinsic sort of resistance – some pain is involved in adding new dependencies.
Npm maintainers had no such constraints. In a way, npm’s better developer experience led to the whole module ecosystem scaling "too well".
Disclosure: I started Socket (https://socket.dev) to help solve open source supply chain security. To learn more, see: https://news.ycombinator.com/item?id=30521913
Well, no, it's because the standard library is so good.
That's biased as hell but it's been my experience
I've seen plenty programmer's with CS degrees make terribly dumb mistakes, and some self-taught developers are some of the smartest people I've worked with.
There are more javascript developers, because JS is far and away the most popular programming environment due mainly to its ubiquity on the web. Because of that the JS supply-chain is a much larger attack surface than most languages.
Self-taught developers were once ardent hobbyists hailing from an era before (we had quite this much) aggressive commercialization of the internet. They found it fun to make computers blink pretty colors.
Self-taught developers today heard you could make a quick buck from the profession.
Industrial sabotage happens in most industries and JavaScript developers are no exception. This particular industry is huge. It contains millions of workers, some of which are politically motivated to engage in this kind of sabotage. The potential reach is even larger. And a well performed sabotage can potentially affect millions of people inside or outside the industry without putting the saboteur in that big of a risk.
I’m actually surprised we don’t see more of this.
If a transitive dependency (the majority of them) have changed, you're out-of-luck.
One question though: how do you think https://socket.dev will compare to https://snyk.io/ and other similar tools? How do you differentiate yourself from competition in the space?
(I've been a big fan of yours since early WebTorrent days.)
Snyk and the entire security industry is obsessed with identifying known vulnerabilities. But they all miss the point. Looking for known vulnerabilities is reactive. Vulnerabilities take weeks or months to be discovered.
A malicious dependency can be updated, merged, and running in production in days or even hours. We need to assume all open source may be malicious and try to proactively detect indicators of compromised packages. A better approach is to detect when dependency updates introduce new usage of risky APIs such as network, shell, filesystem, and more.
And thanks for the WebTorrent love!
24 February Russia attacked Ukraine
The people of Ukraine are universally mobilized and ready to defend their country from enemy invasion
91% of Ukrainians fully support their President Volodymyr Zelensky and his response to the Russian attack.
The whole world condemned the unjustified invasion and decided to impose unprecedented sanctions against Russia. With each new day, they will be felt more and more strongly among civilians.
At the same time, the Russian government restricts citizens' access to external information, planting one-sided formulations and versions of what is happening.
As a reliable source of information, download the secure Tor Browser:
Stop this senseless war! Stop war criminal Putin!
https://github.com/Yaffle/EventSource/commit/de137927e13d8af...
Also looking more at the update, I'm guessing it came from the repo owner (who is in Russia), not necessarily "political activists". Committed by a deleted "Viktor".
Because when I argue that and give example of easter eggs which caused security vulnerabilities or broke shell scripts on certain dates people reply "oh, lighten up, you are just a party killer, allow some human touch"
Absolutely! Undocumented Easter Eggs cannot be tolerated in any software project today.
Larry Osterman wrote about why Microsoft (and most other major software vendors) banned easter-eggs: https://docs.microsoft.com/en-US/archive/blogs/larryosterman...
The important point is (to quote):
> If the manufacturer of the software that's on every desktop in your company can't stop their developers from sneaking undocumented features into the product (even features as relatively benign as an Easter Egg), how can you be sure that they've not snuck some other undocumented feature into the code.
But if an easter-egg is is documented and implemented following normal software engineering practices then that's fine (of course paying customers won't be happy to learn that's where the team is putting their resources), and you can still keep things "secret" by hiding them in spoiler-tags or similar in your changelist - but there must never be any unaccounted-for functionality in a software project.
But there is absolutely a difference between an easter egg, something that usually takes real effort to discover and trigger, and something that runs as part of normal execution.
In regards to the examples you give where it causes vulnerabilities or bugs, I think it can be a test if the software you're actually embedding the egg in needs to be improved. If an easter egg breaks something then that's probably indicative of a larger problem.
This shouldn't be a difficult discussion in this way.
That describes basically all the code I install from open source repos, bar the very specific section of code I actually use.
Personally, I don't think I'd count console.log as "hidden/undisclosed functionality", while I would claim opening a browser window is.
But some people might, and if I was creating a FOSS library I would not include it.
---
EDIT: On second thought, I might consider it functionality:
People have application logs that are exposed to customers (so it would cause the company to appear to be taking a stance), or exported to other systems which only understand certain log messages, causing issues there.
it's open source
Just because something is in the source code doesn't mean it's acceptable - it's not disclosed anywhere the majority of people would look: A readme, a NPM description, documentation, etc.
Iframes need a full web context whilst CSP cant target individual code blocks. For example, I might want my code to be able to do alerts, but I dont want dependency x to be able to.
EDIT: Ah I think thats what you meant by your "code in a sandboxed iframe thing". Fair.
It's not that hard to do some superficial review once and do a diff of node_modules when updating npm-shrinkwrap.json for whatever reason.
It's utterly irresponsible to not do so when pulling code from untrusted sources like npm.
Don't pull in dependencies which have many dependencies themselves. There are many projects that pride itself on minimalism and lack of transitive dependencies. Choose those. Etc.
he can put a ukranian flag on my terminal, just like he can put a russian flag on your terminal, it is the purpose of his library, it's not yours
you decided to rely on this individual for free, without consulting, without asking yourself how updates are delivered and what he plan to do with his code
you are the only one responsible of compromising your company by depending on such library
NPM/Cargo driven development is bad for everyone
if code on NPM/cargo can't be reviewed by moderators, then you can't complain
if you don't review code from your dependencies, then you also have your part of responsibility
Gatsby is the big one, and it doesn't use a lockfile or pin the specific version so any new installation will receive the bad version, but this package is to only be used in development environment https://github.com/gatsbyjs/gatsby/blob/441a5af8e665256c7703....
this.abort = function () {
if (this.signal._reader != null) {
this.signal._reader.cancel();
}
this.signal._aborted = true;
};To experience the exploit set your computer timezone to any Russian timezone (e.g. asia/omsk) and paste the following data URL to your url bar:
data:text/html;charset=utf-8,<!DOCTYPE html><title>EventSource</title><meta charset="utf-8"><script type="module">import "https://unpkg.com/event-source-polyfill@1.0.26"</script>
In 15 seconds an alert window will open with a message which translates to:> On February 24, Russia attacked Ukraine.
> The people of Ukraine are universally mobilized and ready to defend their country from enemy invasion. 91% of Ukrainians fully support their President Volodymyr Zelensky and his response to the Russian attack.
> The whole world condemned the unjustified invasion and decided to impose unprecedented sanctions against Russia. With each new day, they will be felt more and more strongly among civilians.
> At the same time, the Russian government restricts citizens' access to external information, planting one-sided formulations and versions of what is happening.
> As a reliable source of information, download the secure Tor Browser:
> And visit:
> https://www.bbcweb3hytmzhn5d532owbu6oqadra5z3ar726vq5kgwwn6a...
> Stop this senseless war! Stop war criminal Putin!
After you dismiss the alert window a new window will open with the page http://www.change.org/NetVoyne
Snyk and the entire security industry is obsessed with identifying known vulnerabilities. But they all miss the point.
Looking for known vulnerabilities is reactive. Vulnerabilities take weeks or months to be discovered. A malicious dependency can be updated, merged, and running in production in days or even hours.
We need to assume all open source may be malicious and try to proactively detect indicators of compromised packages. A better approach is to detect when dependency updates introduce new usage of risky APIs such as network, shell, filesystem, and more.
Disclosure: I started Socket (https://socket.dev) to help solve open source supply chain security.
- It being web based means you can target this kind of software for maximum "impact"
- NPM dep trees are massive and you generally have thousands of tiny libs. The chance of something like this happening and being noticed goes up therefore.
- NPM ecosystem is a bit more wild west which again leads to increased chance of something like this being able to occur in the first place.
So they end up using it.
You rarely/ever see things like emoji commit messages in the other worlds (ex C#, Java, etc)
Maybe something's are more important than a js package?
The "open source maintainers are not your bitch" argument is moot when one publishes a library on something like npm and then disappears when a security incident happens. I reckon publishing a library on a package manager should come with a promise of responsibility or at least communication.
You need to vet your packages. Always, even if you paid for it.
There are package managers that work with Github repos. Should this apply to every public Github repo too?
I mean it. The open source world, especially the JS ecosystem, desperately needs something like this. And a monetary incentive isn't enough, unless it's significant, but no one will pay $500 a month per JS library they depend on.
A simple ".serious-project" committed to the project root would suffice.
Maybe they should, and if they fail to do so, then maybe they have zero right to complain about it.
I don't believe in Tidelift myself nor I actually pay them any money, but there's that already.
If you're willing to use less recent packets, you can trust vendors like SUSE or Red Hat to do that for you.