We ran an automated behavioral scan over the most-installed npm packages, the kind of check you would drop into CI. About seven in eight came back with nothing flagged. The ones that did get flagged are the interesting part, because few of them are dangerous. They are ordinary, trusted libraries that happen to do something that also shows up in malware.
The usual false alarms
A few patterns cause most of the noise:
- Dynamic code generation. lodash, vue, and webpack all build and run code at runtime with the
Functionconstructor. A template engine compiling a template, and malware unpacking a payload, use the same move. A scanner that flags everyFunction()oreval()flags all of them. - Minified bundles. A minified file trips most heuristics: long opaque strings, dense operators, base64 blobs. To a pattern matcher, a normal package's dist bundle looks a lot like malware.
- Locale and text data. An i18n table full of non-Latin scripts, or a library with a byte-order-mark check, trips detectors built to catch hidden-unicode prompt injection.
- Comments. A comment that says "fetch step 12.1.1.3" reads as a hardcoded IP address to a naive regex.
What actually separates a threat from a false alarm
The primitive on its own means little. The context around it is what tells a threat from a
false alarm. Function() on a template string is a compiler. Function() on a value
that was just base64-decoded or fetched from the network is a payload. A setInterval next to a
fetch and an eval, all in one small loop, is a self-updating beacon. The same three
things scattered across a bundled CLI are a coincidence. Reading process.env is normal. Reading
~/.ssh/id_rsa and posting it to a raw IP is not.
Getting this right is most of the work. A scanner that cries wolf trains you to ignore it, which is worse than no scanner. So we tune hard for precision. We use exact known-bad matching, and behavioral rules that need corroborating context, and we handle minified bundles as the noise they are. Every verdict is bound to a content hash, so you can confirm that what you installed is what got scanned.
See it on your own dependencies
Scan any package free from the browser, or add the
CI action to your repo. A
clear result means no known-bad match and no rule fired. The full evidence for anything flagged is
in the report.
Check your lockfile for known malware. Free, no card.
Lazaretto is the pre-install checkpoint agents call themselves. Try it · pricing · connect your agent.