← Back to all posts
Published on · by Renaud Deraison

The backdoor outlived the package

On November 9, attackers used Ethersphere's own release automation to publish bee-js 13.3.0 to npm and a signed, notarized Swarm Desktop 0.56.2. The npm version was live for 75 minutes, with valid provenance. Its install script stole Swarm wallet keys and planted a backdoor in the home folder that removing the package does not remove. The advisory says any machine that installed it is fully compromised. In Bromure Agentic Coding, the agent's npm never sees a version that young, and if a machine does run it, Rewind home puts the home folder back to how it was before the install.

npm pulled the bad version 75 minutes after it went up. That didn't help anyone who had already installed it, because by then the payload had put its backdoor in their home folder. The advisory's fix is to rebuild the machine.

Early on November 9 (UTC), someone used Ethersphere's own release pipeline to ship malware. Ethersphere maintains Swarm, a decentralized storage network. Its JavaScript library, @ethersphere/bee-js, is what Swarm Desktop, swarm-cli and the Swarm dashboard use to talk to a node. Socket and SafeDep published the technical details, and The Hacker News covered it the same day.

Socket's timeline, in UTC:

  • Nov 8, 23:30: the attackers point an Ethereum smart contract at their command server, 193.57.9.155:4912.
  • Nov 8, 23:59: an unsigned commit, authored as the release bot bee-worker, renames bee-js's prepare script to postinstall and ships the scripts folder in the package.
  • Nov 9, 00:06: a GitHub release v13.3.0 triggers the Publish on npm workflow. Nothing in it requires an approval or checks that the commit sits on a protected branch. The job finishes in 73 seconds.
  • 00:09:50: npm serves @ethersphere/[email protected] as latest.
  • 00:41–00:44: a workflow the attackers started by hand builds Swarm Desktop 0.56.2, signs it with the project's Apple and Windows certificates, gets it notarized by Apple, and the app's updater starts offering it.
  • 01:24:58: npm removes 13.3.0. GitHub advisory GHSA-hh7j-5m3j-23pf follows 29 seconds later.

The package came with valid provenance. Socket verified the attestation offline: it names the real workflow, the real commit and the real publish environment. In Socket's words, provenance "proves where a package was built, not that the source was reviewed." Two GitHub accounts were compromised, the release bot and a long-time maintainer who could still force-push to an unprotected branch. Two days earlier, workflows in two other Ethersphere repositories had tried to dump every CI secret to webhook.site. How the attackers got into either account is still unexplained.

What the install did

Version 13.3.0 was the first of bee-js's 178 versions to declare an install hook. The hook calls https://api.frameworkmetrics.xyz/v1/analytics with an X-Ethersphere: 1 header, and runs whatever JavaScript comes back with Node's real require and process, as the user who ran the install. Without the header, the server sends a decoy. The code comments say the script "must NEVER fail an install."

You didn't have to ask for bee-js to get it. swarm-cli 3.6.0 and 3.7.0, bee-dashboard 0.37.x, @snaha/swarm-id, bee-wasm-js, the file-manager-lib package and any new create-swarm-app project all accept version ranges that include 13.3.0. For those 75 minutes, a fresh install of any of them resolved to the malicious version.

The second stage looks for Swarm Desktop's data folder and uploads two files to /v1/swarm/report: config.yaml, which holds the node's wallet password in plain text, and keys/swarm.key, the encrypted Ethereum keystore it unlocks. With both, the attackers can move the node's tokens, its chequebook and its stake.

Then it moves in. On Linux and macOS it writes a Go remote shell, which SafeDep calls evjawbreaker, to a hidden ~/.solidity folder, and starts it with a systemd user unit named solidity-langsupport-runner.service or a LaunchAgent named com.solidity.langsupport.runner. The implant reads its server address from the Ethereum contract, so there is no fixed domain to block, and the attackers can move it with one transaction. On Windows the payload installs a signed ScreenConnect client as a SYSTEM service, after a UAC bypass when it can.

bee-js 13.3.0, November 8–9 (UTC)23:59 · bot commitunsigned, as bee-worker"prepare" →"postinstall"no pull request00:06 · real pipelineGitHub release startsPublish on npmno approval, 73 secondsvalid provenance00:09 – 01:24 · latest75 minutespulled in by ranges inswarm-cli, bee-dashboard,create-swarm-appnpm installfetches code fromframeworkmetrics.xyzuploads wallet passwordand keystoreWhat stays after npm removes the version~/.solidity/ solidity-langsupport-runner.service com.solidity.langsupport.runnerA remote shell whose server address lives in an Ethereum contract. "Fully compromised," says the advisory.
From a bot's commit to a backdoor in your home folder. The release used the project's real workflow, so the package had valid provenance. Dependents with version ranges pulled it in without anyone asking for bee-js, and the backdoor it planted stays after the package is gone.

Removing the package removes nothing

The GitHub advisory is short: "Any computer that has this package installed or running should be considered fully compromised." The cleanup list that follows is long:

  • Search lockfiles, caches, internal mirrors and CI logs for @ethersphere/[email protected], including indirect copies.
  • Treat any machine or CI job that installed it with scripts enabled between 00:09:50 and 01:24:58 UTC as compromised, even if the install failed.
  • From a clean computer, rotate every password, token and key the installing user could read, including cloud credentials reachable through CI OIDC trust.
  • Move the Swarm node's funds, chequebook and stake to a new key.
  • Delete ~/.solidity/ and the systemd unit or LaunchAgent. Updating, reinstalling or removing the package or the app doesn't touch them.
  • Where possible, rebuild the machine from a trusted image.

On a developer laptop, the last two items take most of a day. "Every password, token and key the user could read" covers ~/.npmrc, ~/.config/gh, ~/.aws, ~/.ssh, every .env in every checkout, the browser's cookies and whatever the agent pasted into its shell history. And rebuilding from a trusted image means reinstalling the laptop.

Coding agents make that day more likely. Scaffolding a Swarm app, fixing a broken build or bumping a dependency all end in npm install, and agents run it without stopping to read which versions it picked. An agent told to "try the Swarm CLI" between 00:09 and 01:24 would have installed 13.3.0 through swarm-cli's version range.

The same 75 minutes in Bromure Agentic Coding

Bromure Agentic Coding runs Claude Code, Codex, Grok, Kimi and omp in Ubuntu VMs on your Mac, one VM per machine. Every package download goes through a proxy on the Mac, and the agent's credentials inside the VM are stand-ins.

npm never saw 13.3.0

The supply-chain age gate is on by default on every machine, with a two-day minimum. The proxy removes versions younger than the cutoff from npm's version listing and points latest at the newest version that's old enough. When the agent asked for swarm-cli and npm resolved bee-js's range, the newest bee-js it could see was 13.2.0. The install went through and the build worked, with no error for the agent to chase.

If the agent had pinned @ethersphere/[email protected] by name, the download would have failed with HTTP 451 and a body npm prints word for word:

Bromure Supply-Chain Security blocked this request: npm package
@ethersphere/[email protected] published 40 minutes ago — policy requires
2 days minimum

npm removed the version after 75 minutes. A two-day gate leaves 46 more hours for the reports to come in. We covered the same pattern on PyPI in The release was two hours old.

The install hook had nobody to run it

npm inside a Bromure machine runs install scripts only for packages on its allow list, and Bromure's managed ~/.npmrc puts only the agent CLIs it ships on that list. bee-js's new postinstall would have been skipped.

The machine's Supply Chain pane adds a second, host-side layer: Strip preinstall / install / postinstall / prepare from npm tarballs on the fly. The proxy removes those hooks from each tarball before it reaches the VM, so even an npm someone reconfigured inside the machine has nothing to run. With a socket.dev key, Block compromised packages refuses packages socket.dev flags as malware, at the download.

Say it ran anyway

Teams that work on Swarm itself would add their own packages under Exempt packages, so they can test a release the minute it ships. Take that worst case: the agent installs 13.3.0 with scripts on, and the payload runs in the VM.

The wallet isn't there. The second stage looks for Swarm Desktop's data folder. On a Mac, that's ~/Library/Application Support/Swarm Desktop. The VM has its own Linux home and sees only the folders you share with it. Swarm Desktop's data folder is not one of them.

The tokens are stand-ins. The advisory says to rotate everything the installing user could read. In a Bromure machine, that user could read ghp_ values GitHub never issued, an NPM_TOKEN that starts with brm_, an AWS secret key that's fake, and an SSH_AUTH_SOCK that asks the Mac for signatures and never holds a private key. The proxy on the Mac swaps each stand-in for the real value only on requests to the host it belongs to. Copied to the attacker's laptop, they fail authentication.

A stand-in sent to the wrong host trips the alarm. If the backdoor packs the machine's tokens into a request to any host they weren't minted for, the proxy blocks it with HTTP 451, pauses the VM, and opens an alert titled This environment may have been compromised. It names the credential, the host it belongs to and the host it was heading for. Save for Investigation exports the VM's disk and home for your incident response before the machine shuts down.

The backdoor needs a way out. Every connection the VM makes passes the Mac's virtual switch and proxy, and the machine's Guardrails pane holds an egress firewall that takes rules by host, IP range, protocol and port. With Unmatched traffic set to Deny, a machine that does web development reaches the registries and APIs on its list, and the implant's raw TLS connection to 193.57.9.155:4912 goes nowhere. The public Ethereum RPC gateways the implant uses to find its server aren't on that list either. Each refused connection is a red row in the Security Timeline.

SafeDep also found that evjawbreaker checks for a debugger or a virtual machine and exits before connecting if it finds one. A Bromure machine is a virtual machine, and the layers above don't depend on the implant noticing.

Machine VMAgent runsnpm i @ethersphere/swarm-clibee-js resolves to 13.2.0If exempted and runno Swarm Desktop wallet heretokens are stand-ins: ghp_…, brm_…SSH keys stay on the MacBackdoor in the VM's home~/.solidity/~/.config/systemd/user/…Your MacAge gate, on by defaultversions under 2 days old areremoved from npm's listingEgress and the tripwiredefault deny: 193.57.9.155:4912and the RPC gateways refusedstand-in to a foreign host: 451, pauseReal secrets, Keychain-sealedswapped in only on requests tothe host each one belongs toCleanupRewind home…pick the boot before the install;~/.solidity and the unit are goneand the rewind can be undoneReset disksystem disk re-cloned fromthe base imageNothing to rotate in the VMreal values change in one pane;stand-ins stay the same
The bee-js install in a Bromure machine. The age gate hides 13.3.0, so npm resolves the range to 13.2.0. If a team exempts its own packages and the hook runs, the payload finds no wallet and only stand-in tokens, the egress rules refuse its server, and a rewind to the last boot before the install removes the backdoor from the home.

Rebuilding the machine takes a click

The advisory's last line says to rebuild the machine from a trusted image. In Bromure you do that from a menu.

The backdoor lives in the home folder: ~/.solidity and ~/.config/systemd/user. A Bromure machine's home is its own disk image, and Bromure takes a copy-on-write checkpoint of it every time the machine boots. It keeps the last few boots, one a day for a week and one a week for a month. Shut the machine down, open ⋯ › Rewind home…, and pick the boot before November 9. The next start comes up with the home as it was then, without the hidden folder and without the user unit. The current home is kept as a new point in the same list, so you can go back to it if you need a file from it.

Reset disk does the same for the system disk: it re-clones it from the base image, and the home is untouched. A throwaway machine started with bromure-cli vm run --rm is deleted when it stops. If the compromise alert fired and you chose Shut down, the machine is marked compromised and won't boot again until you wipe it, which keeps your settings and credentials and replaces the disk and home.

Then the rotation step. The real tokens never entered the VM, so there's nothing there to rotate. If you want to rotate anyway, the real values sit in one place, the machine's Credentials pane on the Mac. Paste a new token there, and the stand-in in the VM stays the same, so nothing inside the machine needs editing.

Finding out who installed it

The first item on the advisory's list is a search: lockfiles, caches, mirrors, CI logs, indirect copies. Bromure records every package fetch in the Security Timeline, whatever the policy, with the package and version in each row, for 90 days. Pick Supply chain in the engine filter and you see npm · @ethersphere/[email protected] with a blue checked — versions newer than the cooldown hidden row next to it, which is the age gate keeping 13.3.0 out. Export… saves it as a CSV.

On Macs enrolled with bromure.io, each fetch is also sent to your organization as a supply_chain.fetch event with the ecosystem, package, version and outcome. "Did any agent in the company install bee-js 13.3.0 on November 9?" is one query, answered across every machine at once.

Bromure's traces then tie a download to the conversation behind it: the tool call and the shell command the agent ran, and the model's turn that asked for it. That's how you tell an agent that went looking for swarm-cli from a build that pulled it in three levels down.

For the maintainers

The bee-js attack started with an unsigned bot commit that turned a prepare script into a postinstall and added a network fetch to a version-numbering script. It sat on GitHub for six minutes before the release. A Bromure code review watches a repository with an agent on one of your machines, on Every new commit or Every new pull request. A reviewer that reads a diff like that one reports it.

The attackers also held a maintainer's GitHub account and the release bot's credentials, and nobody has said how they got them. If the agent on a maintainer's machine works in Bromure, its GitHub token is a stand-in, and new machines put every forge in Prompt before write, so a push or a release made from the VM waits for a dialog on the Mac.

Too young to install

The age gate ships on, at two days. npm in the machine never saw a version that was gone 75 minutes after release.

No hook to run

npm in the VM runs install scripts only for the agent CLIs. The proxy can also strip the hooks from every npm tarball.

Nothing worth taking

No wallet in the VM, only stand-in tokens, and a stand-in sent to the wrong host pauses the machine.

Rewind past it

Home checkpoints at every boot. Rewind home removes the backdoor, and Reset disk restores the system disk.

What to do this week

If you or your agents work with Swarm:

  • Search lockfiles and npm caches for @ethersphere/[email protected] and pin 13.2.0.
  • Check bee-desktop.log for Bee Desktop version: 0.56.2 (production) and move to 0.56.3.
  • Look for ~/.solidity/, solidity-langsupport-runner.service and com.solidity.langsupport.runner, and hunt DNS and proxy logs for api.frameworkmetrics.xyz, 193.57.9.155 and 185.232.84.169.
  • If 13.3.0 or 0.56.2 ran, move the node's funds and stake to a new key from a clean computer.

If you publish packages, Socket's advice applies to any project: check in the publishing workflow that the commit is on a protected branch, require reviewers on the publish environment, and keep signing certificates away from workflows anyone can start on any branch.

Then give your agents a machine where a package like this one finds nothing to steal, and where you remove what it leaves behind from a menu. Setting the age gate, script stripping and egress rules is covered in the Supply-Chain Protection chapter of the manual.