2026-02-05 — NPM optimizer-cpu malware (GHSA-x66r-5jww-pf82)¶
Source: https://github.com/advisories/GHSA-x66r-5jww-pf82
Published: 2026-02-05
Type: Malware / supply-chain compromise
What happened¶
The NPM package optimizer-cpu was flagged as malicious. GitHub’s advisory text states that any machine that installed or ran it should be treated as fully compromised.
Why this matters (durable guidance)¶
Supply-chain malware incidents are increasingly common, and the response playbook is broadly reusable: - Assume credential theft (env vars, SSH keys, cloud creds, tokens, browser cookies, CI secrets). - Assume persistence (cron/systemd launch agents, shell profile modifications, new binaries). - Assume lateral movement if the machine had network access to sensitive systems.
What to do now (triage)¶
If you suspect this package was installed or executed:
- Isolate the host
-
Remove from network (or at least block egress) to stop further exfiltration.
-
Rotate secrets from a clean machine
-
Rotate all credentials that were accessible from the affected host (GitHub tokens, NPM tokens, cloud keys, SSH keys, DB creds, etc.).
-
Rebuild rather than “clean”
-
Prefer re-imaging/rebuilding the machine (and CI runners) over attempting removal.
-
Hunt for additional exposure
- Identify where the host authenticated: GitHub orgs, cloud accounts, package registries, VPNs.
-
Review logs for suspicious authentication and outbound connections.
-
Pin/verify dependencies going forward
- Use lockfiles, private registries/allowlists, provenance (where available), and dependency review gates.
September 23 follow-up: Perl Crypt::SelfCertificate — payload hiding patterns worth memorizing¶
GHSA-9ppr-x3mg-6jg2 / CVE-2026-95831 (high): Crypt::SelfCertificate 1.01–1.05 for Perl ships a Python dropper saved as a certificate file — lib/Crypt/SelfCertificate/sample/validate.p12 (1.01) and lib/Crypt/SelfCertificate/sample/cert7.pem (1.05) — whose generate_certificate path fetches code from a hardcoded base64-obfuscated http URL and executes the response body directly, with no dropped script on disk. Durable axes for both hunters and implant-triage:
- Extension camouflage in
sample/and data directories. Payloads hide behind.p12/.pem/.keynames inside packages whose stated job is certificates — a reviewer skimming for.py/.shmisses them. Hunt rule for any registry package:file(1)every non-source data file (magic bytes, not extension) inshare/,sample/,data/,test/directories; a "certificate" that starts with#!/usr/bin/env pythonis the finding. - Missing test scripts and build hooks in an otherwise-normal package is a signal, not sloppiness. The advisory notes the releases carry no tests or build hooks — a package published straight from a working tree with zero QA scaffolding is anomalous for anything with dependents.
- No-drop execution (
urllib→exec) means disk-image hunting fails. Triage evidence lives in process trees, egress logs to base64-decodable destinations, and the package tarball itself — the advisory helpfully publishes SHA-256s of both dropper files for sweep queries (search EDR/file-integrity for thevalidate.p12/cert7.pemdigests before decoding anything). - Copy-forward pattern for authorized red-team tooling reviews and for registry-sweep hunting: obfuscate-the-c2-URL + trusted-extension filename + trigger-on-normal-API-call is the standard low-visibility CPAN/PyPI/npm implant shape; treat any package that executes its own data files as suspect.
References¶
- GitHub Advisory: https://github.com/advisories/GHSA-x66r-5jww-pf82
- Related checklist: /checklists/malicious-package-response.md
- Related best practice: /best-practices/supply-chain-malware-triage.md