A few months ago another npm package got hacked. Someone took over a
maintainer account, pushed a bad version, and a lot of CI pipelines
downloaded it within minutes.
What bugged me is that most tools only help after the advisory is out.
By then your build already ran the code. I wanted to stop the package at
download time, and not ask developers to change anything.
So I started building SilicaProxy.
How it works
It's a proxy. It sits between your artifact repository (Nexus,
Artifactory, whatever you use) and npm, PyPI and Maven Central.
Every download goes through it. It checks the package and says yes or no.
What it checks today:
- known vulnerabilities (OSV, GHSA and others, stored locally)
- versions published only a few days ago (quarantine)
- deprecated or yanked packages
- public packages with the same name as your internal ones (dependency confusion)
- your own allow/block list, kept in a Git repo
The vulnerability data is local, so builds don't wait for an API call.
Two extra services
Lists are not enough. A brand new malicious package is in no list yet.
So I made two small services the proxy can call.
Package Name Guardian finds typosquatting, like lodahs instead of
lodash. It compares the name with the most popular packages and uses
three similarity algorithms that vote.
Package Behavior Guardian looks at what the package really does. The
main case is a good package that gets a bad new version, for example one
that steals credentials when you install it.
Write your own checks
The part I like most is that the proxy is not a closed box. Any HTTP
service can be plugged in as a check.
The proxy sends a POST with the package name, version and ecosystem.
Your service answers "allowed" or "blocked". It can answer right away,
or take its time and call the proxy back later. That second mode is good
for slow scans, or even for a human who has to approve a package.
You can also run a new check in shadow mode: it gives a verdict, the
verdict is stored, but nothing is blocked. That way you can test it on
real traffic before you trust it.
Some ideas I have in mind: a license checker, a Slack approval flow,
an OpenSSF Scorecard threshold, a SBOM archive, or an adapter for the
scanner your company already pays for.
Package Name Guardian and Package Behavior Guardian are just two examples
of this. If you write another one, I'd love to hear about it.
