5 ms·
A backdoor in the Ruby gem bootstrap-sass
- TheRealDunkirk 8y agoI was going to make a joke that no one here could be impacted, because no self-respecting HN reader uses Rails today, or Bootstrap, for that matter. However, the lack of voting and comments seem to indicate that this isn't much of a joke. Nevermind me; I'll go back to writing a bunch of new Rails sites now.
- not_a_moth 8y agoEarlier in my career I was a Rails dev. Since it's on my Linkedin, I get PMs at least once a week about Rails gigs from companies in SF/SV. Rails isn't dead. Furthermore having had stints with Django and React, I think Rails is still by far the simplest and most pleasurable way to build webapps. Their core philosophy of maximizing developer happiness has something to do with it.
- cortesoft 8y agoGitHub is still rails, as is Shopify.
- dwheeler 8y agoGitHub, GitLab, Shopify, and many other sites use Rails. It's still a good choice for certain kinds of sites.
- pdkl95 8y agoRails is (and has been) a pleasure to use for fast, easy-ish development if you usually stick to the "Rails style" recommend naming schemes, etc. If you are trying to adapt an existing project/db that uses some other style, Rails might not be the best tool to use. When you have to supply explicit table/key/route name overrides to everything, you loose a lot of the benefit of using Rails (or any other very-opinionated tool). I loved using rails for multiple projects, but it's worth making sure it's actually a good fit for the project before jumping in.
- whycombagator 8y agoPretty sure Stripe and SendGrid are too
- avip 8y agoSo is Lemonade (house insurance app)
- h1d 8y agoDiscourse too. But frankly I wish people stop making publicly releasing software as rails app, the resource usage is just insane. I always have to upgrade my server just because of running a single rails app.
- nightfly 8y agoI treat bootstrap like GTK+ for the web. When I need an application, that happens to be a website, to have a consistent/nice look/feel without having to "design" it.
- igolden 8y agoGlad to see the ruby community handled this quickly and professionally. Proud rubyist here. Far cry from the way a recent npm vuln was handled.
- jake-low 8y agoAre you referencing the ESLint backdoor? From my recollection, the two incidents seem really similar. Both were noticed and unpublished quickly. Both could have been prevented by 2FA. Can you elaborate on why you think this incident was handled better?
- gedy 8y agoFor some reason, a subset of Rails community feels compelled to boost it by knocking whatever is more popular, e.g. Java in the old days, JavaScript these days. Rails is fine, but that aspect of the community is unnecessary and immature.
- uponcoffee 8y agoIt's not fair characterize a whole community by the actions of individuals; it's just throwing around more mud. Aside from the root comment, there is no evidence here to support the broad strokes you're making.
- gedy 8y agoI specified subset, and it's from my experiences over the years.
- zer01 8y agoYeah if you're going to sling shit like this, link to your sources. I've handled incidents involving both ecosystems over the past year and they're pretty comparable. NPM also bought a security company (https://blog.npmjs.org/post/172793182214/npm-acquires-lift-security-and-node-security 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.
- dwheeler 8y agoI posted some ideas on how to reduce the risk of this kind of problem in the future. See: https://dwheeler.com/essays/bootstrap-sass-subversion.html https://dwheeler.com/essays/bootstrap-sass-subversion.html
- freedomben 8y agoI agree that it is likely low impact: > 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.
- ownagefool 8y agoYeah. Zero trust for all systems, including your own. You need TLS and Auth, preferably the users Auth if the app requires that. 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.
- throw2016 8y agoThis is a bit like saying we left the safe open and nothing was stolen so its not that big of a security problem. The specifics of the exploit is besides the point as it could be anything. 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.
- freedomben 8y agoI agree with you, but I do think the ease with which dependencies are managed in eco-systems like Ruby and JS is quite valuable. As most security-related things it's a cost/benefit analysis, and the benefit of the current systems are very high. 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.
- temp2903d 8y agoCan someone explain what the backdoor could do? It's exposing some session token that someone could then use to login an account on some website that used this gem?
- akramer 8y agoIt appears to evaluate ruby code provided by the client given specific strings being set in a cookie.
- CGamesPlay 8y agoEverything in the first line is a diversion to make the code look complicated but realistic. The eval is what the backdoor does, which means it looks at a cookie with some basic encoding, and runs it as ruby code. There’s no authentication or anything here, the backdoor will work for anyone who cares to set that cookie.
- newnewpdro 8y agoIt runs arbitrary ruby code supplied in the form of a cookie. 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.
- quickthrower2 8y agoDupe? https://snyk.io/blog/malicious-remote-code-execution-backdoor-discovered-in-the-popular-bootstrap-sass-ruby-gem/ https://snyk.io/blog/malicious-remote-code-execution-backdoo... https://news.ycombinator.com/item?id=19569959 https://news.ycombinator.com/item?id=19569959
- sudoaza 8y agoThis is at least a week old news and was promptly fixed.
- patrickdavey 8y agoWhat I was curious about was why it targeted a fairly old and quite specific version of the gem. Made me think they had a specific target in mind. Also, pretty impressive it was found so quickly.
- homakov 8y agoNext, imagine a bad library hijacks all other libraries on dev machine and compromises them too. A true pandemic warm begins. Will happen eventually to gems or npm.
- vemv 8y agoA few more of these and we'll all ditch package managers in favor of plain git repos. Commit SHAs inherently guarantee content integrity.
- daxelrod 8y agoCan you elaborate on how you see this as an integrity problem? A new malicious version was released; at no point did the attackers represent their new release as the same code as the previous release.
- vemv 8y agoWhen you "git all the things", upgrading a dependency can equal a `git diff`. Upgrades become reviewable. I envision a future where organisations routinely review upgrades.