maennchen

maennchen

What if the BEAM ecosystem got hit by a worm?

One package.
One update.
A worm crawling through the BEAM ecosystem.

A dark “what if” — and how we can stop it before it’s real.

Most Liked

BartOtten

BartOtten

  1. Keep human control
    After reading the post-mortem of the npm-debacle, one takeaway stands out to me: we should avoid letting CI automatically update packages and dependencies. Keeping this as a manual step—with 2FA—adds a valuable layer of control. It’s a bit like the stock market: crashes sometimes happen when automated systems react blindly to one another’s signals.

  2. Don’t trust humans (yourself)
    Earlier this month, Josh Junon was targeted by a successful phishing attack. While we don’t have full details—such as whether a password manager was in use—it’s notable that the phishing domain (npmjs[.]help) was a clear lookalike. A good password manager would typically flag this, which raises the possibility that one wasn’t used or its warning was ignored. Both could have been prevented and, imho, should have due to the sizes of the packages install base.

  3. The way forward!
    The BEAM ecosystem currently lacks some critical safeguards that could help prevent these types of incidents. That’s why investing in the development of stronger tools and practices is not just important—it’s essential as clearly stated in the linked post.

  4. In the meantime
    In the meantime, let’s stay vigilant, support one another, and make security a shared responsibility.

Lookout fir yourself aaand each other - Jerry Springer.

maennchen

maennchen

That’s not really the thing I would like people to take from this. Having the possibility that CI’s can publish makes a lot of sense, but only if done right. (Release Environments in GH for example so that only select jobs triggered by the right people get access).

I for sure prefer a clean CI setup over a large project handing out control to a lot of people.

One other way is to force WebAuthn based 2FA for all package maintainers. WebAuthn will not work on any domain.

garrison

garrison

Why not allow CI to build/upload new package versions but then add an additional (browser) 2FA step to “publish” the new version? That way a compromised API token would be much less dangerous but you still get the benefits of CI.

Keep in mind that building on developer machines offers no security benefit here. A lot of these attacks have actually targeted developer machines. It’s only the 2FA step that matters.

A great first step would be to support WebAuthn 2FA at all.

BartOtten

BartOtten

That’s what I meant.

But you still risk chain attacks that extract secrets from the CI env. There are ways to circumvent it (Release Env’s being one of them), but if major NPM-package maintainers ‘fail’ to do it property, how much should we trust ourselves and others?

Example: only a few weeks ago I realized GH pages were generated and published for every PR. A slight oversight. Each PR could simply add JS or add an extra dependency to the installation instructions.

garrison

garrison

Well sure but building outside of CI doesn’t help with that.

All you can really do here is either carefully vendor and check your deps or keep important secrets out of CI.

The 2FA-for-publish strategy is option B there: it makes the secret (hex API key) unimportant (because it can no longer publish).

Fundamentally it seems like the lesson from this npm business is that, actually, communities catch these attacks pretty fast. It’s just that they’ve built tools which propagate code even faster.

Where Next?

Popular in Blog Posts Top

brainlid
Phoenix 1.7.0 brings a lot of new things when we run mix phx.gen my_app. These new and cool ways of doing things aren’t automatically bro...
New
fredwu
Hi folks, I wrote a blog post the other day on how I built my MVP in 3 months whilst having a day job, using Elixir/Phoenix/LiveView. Th...
New
brainlid
Livebook was created for machine learning in Elixir but Livebook isn’t limited to machine learning. I found it works really well for docu...
New
danschultzer
How to set up the Content Security Policy header with Phoenix LiveView and support inline styles and scripts with CSP nonces.
New
New
New
aymanosman
The desire to produce structured logs is common. In this article, I will survey the major approaches one could take to achieve this goal ...
New
brainlid
Elixir has a built-in Zip library that comes with OTP. This post explores how to use the zip module and asks the important question: “Is ...
New
zachdaniel
In this post I explore the silos that exist in the Elixir ecosystem, the pros and cons, and what we can improve.
New
brainlid
Dialyzer is a tool that you’ve probably heard about in the Elixir community. You may have even used it. However, adding Dialyzer to an ex...
New

Other popular topics Top

stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New

We're in Beta

About us Mission Statement