Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
Malicious package

better-dotenv3npm

better-dotenv3 is a confirmed malicious npm package (MAL-2026-17172) that typosquats a legitimate package to trick installs (malicious version 1.0.1). Do not install it — remove it immediately and rotate any exposed credentials.

Malicious code in better-dotenv3 (npm)

MAL-2026-17172
Immediate action
Remove the package, then rotate any secrets the build/runtime could reach.
npm uninstall better-dotenv3

What this malware does

The package is a dotenv typosquat that runs a hidden Windows loader on every require() and on CLI startup. dist/index.cjs and dist/cli.cjs invoke dispatchAnalytics() unconditionally at module top-level; that routine reads a bundled JPEG (dist/stest.jpg), parses its APP13 segment (marker 0xED) to extract a hidden UTF-8 payload, writes a self-deleting relay_[...].vbs into os.tmpdir(), and spawns wscript.exe detached with windowsHide:true to launch powershell.exe -NoProfile -NonInteractive -EncodedCommand carrying the extracted payload. Executable names and switches are assembled at runtime by joining split character arrays (['power','shell','.exe'].join(''), ['-No','Profile'], ['-Non','Interactive'], ['-Encoded','Command'], ['wscript','.exe']) to evade static string scanners, and the second-stage script is concealed inside the image rather than shipped as source. The tarball's internal identity does not match its advertised name: the bundled package.json inside dist/cli.cjs declares name:'node-env-buffer' version 2.2.6 while the outer package advertises better-dotenv3, indicating the same loader is being republished under multiple dotenv-lookalike names.

Malicious versions

1 flagged
1.0.1

Indicators of compromise (SHA-256)

f996c75c75423a57a64c1c89b04f2e1ba87674973dba2dd359df5b0937ffe3cf

Detection & response playbook

Typosquat
  1. Find it

    Scan your lockfiles (package-lock.json, pnpm-lock.yaml, yarn.lock, requirements.txt, poetry.lock, etc.) and build artifacts for better-dotenv3 (version 1.0.1). O3 Security's supply-chain scanner checks every dependency against known-malicious package intelligence at install time and in CI, flagging better-dotenv3 across your stack and pipelines.

  2. If you installed it — respond

    better-dotenv3 is a typosquat — you almost certainly intended a legitimately-named package. Remove better-dotenv3, install the correct package, and rotate any secrets exposed during the install since post-install scripts may have already run.

  3. Did it already run?

    If better-dotenv3 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.

  4. How O3 protects you

    O3 blocks better-dotenv3 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

No. better-dotenv3 on npm has been identified as a malicious package (version 1.0.1 flagged). It should be removed immediately — do not install or keep it in your dependency tree.

Campaign

IN-MAL-2026-020523

References

Credits

  • Amazon Inspector · finder

Detect & block this

O3 blocks better-dotenv3-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the malicious outbound activity and severs the channel.

Explore

better-dotenv3 (npm) malicious package — MAL-2026-17172 | O3 Security