Back to blog
CVEsupply chainnpmtechnical

npm worm on transactional mail packages: when a mailer library quietly BCCs your payroll emails

Published on 2026-07-266 min readCleanIssue

> TL;DR: A widely used transactional mailing npm package (several million weekly downloads) was compromised after an attacker stole a maintainer's npm credentials. The malicious version adds a single line of code that blind-copies (BCC) every email sent through the package to an attacker-controlled address, then self-removes from the codebase after a few days to muddy the trail. Applications sending payslips, invoices, or password reset links via this package may have leaked those documents in plaintext during the compromise window.

Why this concerns you directly

If your HR or payroll SaaS sends payslips, payment confirmations, or magic login links by email, chances are it goes through a third-party library rather than a hand-rolled SMTP server. That's exactly the surface targeted here: not your code, not your infrastructure, but a dependency you added one day with npm install and never re-checked since.

The scenario is particularly nasty for HR emails: a payslip contains a name, IBAN, net salary, sometimes a national ID number. A password reset email grants direct account access. Both are prime targets, and both typically flow through this kind of package.

How the attack worked

  • Maintainer account takeover. The attacker obtained the lead maintainer's npm credentials via a phishing email impersonating an official npm security alert (the irony is not lost on anyone).
  • A poisoned release. A new minor version of the package was published, with an innocuous changelog ("fix: minor typing issues").
  • The backdoor. The added code is minimal: before sending each email, it adds a hardcoded BCC address, base64-encoded to dodge basic automated scans.
  • Self-cleanup. After 96 hours, a "clean" version was automatically published to make the backdoor disappear from the source, while applications that hadn't redeployed since remained vulnerable until they explicitly pinned their version.
  • Detection. A customer who noticed suspicious bounces to an unknown domain in their SMTP logs raised the alarm, six days after the initial release.
  • What makes this attack hard to detect

    Unlike a classic API key theft that generates easily-spotted abnormal outbound traffic, this attack only slightly modifies an already-legitimate flow: email sending. SMTP traffic volume barely changes. No new domain shows up in your application logs — only in the BCC header of each email, invisible without manually inspecting sent content.

    What to check right now

  • Audit your mailing dependencies. List every package used for transactional email sending (mailers, templating, SMTP wrappers) and check their recent npm publish history.
  • Pin your versions. Use strict lock files (package-lock.json with npm ci, never npm install in production) to prevent an automatic update from pulling in a compromised version.
  • Inspect your SMTP logs for unexpected BCCs. If your SMTP provider logs full headers, look for BCC addresses that don't appear in any configuration your team recognizes.
  • Consider auditing actual sent content. Not just recipient logs — the full MIME content of a sample of outgoing emails, to spot a silently added header.
  • Separate sensitive emails from the rest. Payslips and authentication notifications should ideally travel through a distinct sending path, with its own logs and alerts, rather than the same generic pipeline as marketing emails.
  • The takeaway

    This isn't the first npm supply chain attack, and it won't be the last. What's different here is the target: not cloud keys or crypto wallets, but the silent exfiltration of sensitive HR documents through a channel — transactional email — that most teams never monitor at the content level. If your product emails sensitive data, the question isn't just "which package am I using" but "who can read what this package sends on my behalf."

    Building HR, payroll, or recruiting software? CleanIssue performs security audits for HR SaaS in real-world conditions, no source code access needed. For a first read of your exposure, start with an external review of your application.

    Need an external review of your HR SaaS?

    Share your product, stack, and client context. We will come back with the right review scope.

    Discuss your audit