
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
@nodesecure/npm-security-fetcher
Advanced tools
a Node.js CLI created to simplify the analysis of npm registry packages.
I personally created this project to analyze npm packages by various criteria (popularity etc). Most researchers re-create the same codes over and over again and I thought it might be nice to have a CLI and various methods to simplify our lives.
This package is available in the Node Package Repository and can be easily installed with npm or yarn.
$ npm i npm-security-fetcher -g
or
$ git clone https://github.com/fraxken/npm-security-fetcher.git
$ cd npm-security-fetcher
$ npm ci
$ npm link
Then the nsf binary will be available in your terminal.
$ nsf --help
The first step is to create a javascript file with three methods:
This script must use the latest Node.js ESM (it also support top-level-await).
import path from "path";
export async function init() {
const baseDir = path.join(process.cwd(), "results");
return { baseDir }; // <-- init and return context object!
}
export async function close(ctx) {
console.log("close triggered");
}
export async function run(ctx, { name, location, root }) {
console.log(ctx.baseDir);
console.log(`handle package name: ${name}, location: ${location}`);
}
There is no restriction on the nature of the context.
After editing your file you can run your script as follows
$ nsf npm myfile.js
The root folder "example" contains real world examples that are used (for js-x-ray etc).
Thanks goes to these wonderful people (emoji key):
Gentilhomme 💻 📖 👀 🛡️ 🐛 | Nicolas Hallaert 📖 | WildCöde 💻 | Kouadio Fabrice Nguessan 🚧 |
MIT
FAQs
Fetch packages from npm for Security purposes
We found that @nodesecure/npm-security-fetcher demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.