npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

shai-hulud-scan

v1.1.2

Published

A CLI tool for detecting the 'Shai-Hulud' npm supply chain attack that occurred in September 2025

Downloads

144

Readme

Shai-Hulud Supply Chain Attack Detection Tool

🔍 A CLI tool for detecting the "Shai-Hulud" npm supply chain attack that occurred in September 2025.

Features

  • ✅ Support for detecting package-lock.json, yarn.lock, and pnpm-lock.yaml files
  • ✅ Recursive directory scanning
  • ✅ JSON format output support
  • Zero third-party dependencies - Fully self-contained, no external packages required
  • ✅ Support for npx direct execution
  • ✅ Lightweight - Uses only Node.js built-in modules

Installation

Recommended: Use npx (no installation required)

npx shai-hulud-scan

Global installation

npm install -g shai-hulud-scan
shai-hulud-scan

Usage

Basic scanning

# Scan current directory
shai-hulud-scan

# Scan specified directory
shai-hulud-scan /path/to/project

Advanced options

# JSON format output
shai-hulud-scan --json

# List all scanned lock files
shai-hulud-scan --list-files

# List files in JSON format
shai-hulud-scan --list-files --json

# Specify directory and output JSON
shai-hulud-scan --dir ./src --json

# Show help information
shai-hulud-scan --help

# Show version information
shai-hulud-scan --version

Output Format

Standard output

❌ Found 3 packages affected by Shai-Hulud attack:

❌ ALERT: @ctrl/[email protected] in /path/to/package-lock.json - Known risk
❌ ALERT: [email protected] in /path/to/yarn.lock - Known risk
❌ ALERT: [email protected] in /path/to/pnpm-lock.yaml - Known risk

JSON output

[
  {
    "package": "@ctrl/[email protected]",
    "lockFile": "/path/to/package-lock.json",
    "severity": "high",
    "type": "shai-hulud-compromise"
  }
]

List files output

Found 3 lock file(s):

📄 /path/to/package-lock.json (npm)
📄 /path/to/yarn.lock (yarn)
📄 /path/to/pnpm-lock.yaml (pnpm)

List files JSON output

[
  "/path/to/package-lock.json",
  "/path/to/yarn.lock",
  "/path/to/pnpm-lock.yaml"
]

How it works

The tool recursively scans the following files in the specified directory:

  • package-lock.json (npm) - Supports v1 and v2+ formats
  • yarn.lock (Yarn) - Supports various yarn.lock formats
  • pnpm-lock.yaml (pnpm) - Supports standard pnpm lock format

Checks for npm packages and versions that were compromised in the "Shai-Hulud" attack.

Parsing capabilities

  • package-lock.json v1/v2+ - Full support for all npm lockfile versions
  • yarn.lock - Supports standard yarn.lock format, including multi-package names and complex dependencies
  • pnpm-lock.yaml - Supports standard pnpm lock format, including scoped packages
  • Zero-dependency parsing - Uses custom parsers, no external YAML or JSON libraries required
  • Error handling - Gracefully handles file parsing errors and permission issues

Using in CI/CD

GitHub Actions

name: Shai-Hulud Security Scan

on:
  push:
    branches: [main]
  pull_request:

jobs:
  security-scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Run Shai-Hulud Scan
        run: npx shai-hulud-scan

License

MIT License

Contributing

Issues and Pull Requests are welcome!