A backdoor in the Ruby gem bootstrap-sass
lwn.net
lwn.net
> In the grand scheme of things, this backdoor likely has a fairly low impact. As noted, the backdoor was found and fixed quickly but, for a little while, it did have the potential to wreak havoc on affected sites. It is a popular gem, but the version that was backdoored was not from the current 3.4.x branch; 3.2.0.2, which was the last good version before the compromise, was released in September 2014.
Always a good reminder tho to use a defense-in-depth strategy. Containerize your applications and keep the image as lean as possibly so the attacker's capabilities are minimized.
But also, assume it will happen so use some auditing and alerting capabilities to detect.
Review the code you're trusting, or at least look at who's shipping it so you know what your trusting ( random individual / reliable group ).
Scan as many dependicies you have, so you're aware of these rather than just luckily reading it on hacker news.
All this is really just the MVP.
This is an indictment of the designers of wild lands systems like ruby Gems and npm and a culture of pulling in hundreds of dependencies that simply cannot be verified by end users.
It's one thing if this was just for developers who made a conscious decision to use a gem or npm package, but the whole system is carried on to end users who are expected to have a build environment and pull in hundreds of unknown gems and packages which in turn pull in their own dependencies simply to deploy.
This is bad engineering and design, it not only dramatically increases the complexity of deployment and wastes millions of man hours in debugging, versioning and build issues but leaves end users exposed to security issues.
I do wish we'd move toward more of a system of forced MFA, GPG signed binaries, and a lot more conservatism on the part of developers before pulling in other gems. I don't think it's realistic to abandon it.
Far cry from the way a recent npm vuln was handled.
Aside from the root comment, there is no evidence here to support the broad strokes you're making.
NPM also bought a security company (https://blog.npmjs.org/post/172793182214/npm-acquires-lift-s...) and integrated NSP directly into NPM in the form of `npm audit`.
Ruby/Gems has `bundler-audit`, which is equally good, but a separate project with a looser integration.
I was referring to the 'event-stream' incident in which the package maintainer unknowingly passed it off to a new malicious maintainer (he has 100s modules). The farcry between the two was that the original maintainer basically wiped his hands clean from incident, whereas in this _specific_ scenario the maintainers of 'bootstrap-sass' offered suggestions on how to improve the security and prevent similar events in the future. I was impressed by the prompt and professional response by the maintainers, that's all.
That being said - I generalized my comment too much, and I agree with zer01 that npm and bundler communities are very comparable and both do a great job.
Also, pretty impressive it was found so quickly.
I envision a future where organisations routinely review upgrades.
This means the backdoor is fully generic and nobody can describe the damage, if any, that has been done.
The only saving grace is the code will run with the privileges of the ruby interpreter, constrained to the process environment of same.