r/coolgithubprojects • • 8d ago

wormsign: one command to check if your laptop has any of the hacked npm or Python packages from this year's attacks

Post image

After the ChainDrop worm went through 444 npm packages in August, I wanted to know whether my laptop had picked any of them up. I had 236 lockfiles and package installs spread across old projects, global npm and the npx cache, so checking by hand wasn't realistic. Upgrading a bad package also doesn't remove the Claude Code hooks or VS Code tasks these worms add so they can run again.

I put together a first version with Claude Code doing most of the typing, and I've been iterating on it since. It checks every installed package version against OSV's malware list, then looks at agent hooks, MCP configs, folder-open tasks, dev containers and startup entries like LaunchAgents and crontab. If something's critical, it tells you which credentials on the machine to rotate.

It's a single Go binary. A full scan of my laptop takes about 7 seconds, and wormsign --demo shows what a hit looks like on a fake project.

brew install mansoor-mamnoon/tap/wormsign

It only sends package names and versions to api.osv.dev, and --offline skips even that. I'd like to hear about false positives, or worm indicators it's missing.

https://github.com/mansoor-mamnoon/wormsign

22 Upvotes

12 comments sorted by

2

u/Express-Priority-441 8d ago

What gets sent to OSV? Some of my company's packages are private.

2

u/scared_corgi_998 8d ago

Package name, ecosystem and version, sent to api.osv.dev. That can include private package names, which is why the README says so. No paths, file contents or credentials leave the machine, and there's no telemetry. --offline skips the lookup entirely and runs only the local checks.

1

u/sleight42 8d ago

Stopping in to compliment you on the crazy good alignment between problem solved, scifi reference, and name.

2

u/scared_corgi_998 7d ago

Haha thanks! May thy knife chip and shatter.

1

u/[deleted] 8d ago

[removed] — view removed comment

1

u/scared_corgi_998 8d ago

npm audit checks one project's dependency tree, and it mostly reports known vulnerabilities. wormsign checks every project under your home directory at once, plus global installs and the npx cache, and it only reports packages flagged as malware (OSV's MAL- entries). The other difference is that it looks for what a worm leaves behind after you've upgraded the bad package: Claude Code hooks, VS Code tasks that run when a folder opens, LaunchAgents and so on.

0

u/[deleted] 8d ago

[removed] — view removed comment

1

u/scared_corgi_998 8d ago

The package is gone, but its install script already ran. ChainDrop and the Shai-Hulud family wrote files outside node_modules so they'd run again. One example is a SessionStart hook in .claude/settings.json, which runs every time you open the repo in Claude Code. Another is a VS Code task with runOn: folderOpen. ChainDrop also installed a gh-token-monitor LaunchAgent on macOS. None of those are touched when you run npm install again.

1

u/scared_corgi_998 8d ago

It shouldn't. A hook that only runs something like prettier isn't reported. It's flagged when the command matches a pattern, and severity depends on which one. A known worm file name or domain is critical. Generic patterns like curl | sh, node -e or posting data to a server are only warnings, even several at once, because normal tools do those things. The report also shows the command with tokens masked, so you can tell at a glance whether it's yours. On my own machine it warned about an old course repo's hook that posts git info to a server. Not malware, but I didn't know it was there.

0

u/[deleted] 8d ago

[removed] — view removed comment

1

u/scared_corgi_998 8d ago

Yes. There's a GitHub Action that runs wormsign --project on the checked-out repo.