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

date-fns-formatternpm

Advisory published Updated

date-fns-formatter is a confirmed malicious npm package (MAL-2026-15974) that typosquats a legitimate package to trick installs (malicious versions 1.3.8, 1.3.9, 1.3.10…). Do not install it — remove it immediately and rotate any exposed credentials.

Malicious code in date-fns-formatter (npm)

MAL-2026-15974
Immediate action
Remove the package, then rotate any secrets the build/runtime could reach.
npm uninstall date-fns-formatter

What this malware does

The package impersonates the popular date-fns library. Its main module, date-fns-formatter.js, contains a small formatDate shim as a decoy in front of a heavily obfuscated IIFE (obfuscator.io-style rotated string array with a runtime decoder) that runs whenever the module is required. The IIFE creates a hidden directory under os.homedir(), writes a package.json declaring axios, better-sqlite3, node-machine-id, and socket.io-client (plus ffi-napi on Windows), invokes npm install (via npm.cmd through cmd.exe on Windows) to fetch those dependencies, decodes and writes a second obfuscated script (main.js) reassembled from a ~200-piece string array containing base64-encoded https:// URL fragments, and spawns node main.js. On Windows a.vbs wrapper is written that uses WScript.Shell.Run(..., 0, False) to launch the second stage hidden and detached. The provisioned second stage (socket.io-client + node-machine-id + ffi-napi) is a persistent WebSocket remote-agent keyed by a stable host fingerprint, enabling remote command execution on the installer's host. The manifest also self-references date-fns-formatter as its own dependency, and the README example is nonsensical, consistent with a cover-story typosquat rather than a broken legitimate package.

Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.

Malicious versions

4 flagged
1.3.81.3.91.3.101.4.9

Indicators of compromise (SHA-256)

4697d7421598f74c2fab37872abece4c92699f612f6b4e54c7eb6c5a1b51d7c1
30a385c281b715de9ad8540342bfb6b592dc7688d3dc8e8bef5eea52c013ad51
548457e90ad2b7512c9bff16ed57e12035536d071c129a715fb086eef02f7074
c699acf542e5445bdd7b31dd2927d59cf860e51da465fbb9479f14768f0f03f5
e9839e9520db45a2a739a415767a8258e15afee65cee71fe5ff41777cbd22450

Detection & response playbook

Typosquat
  1. Find it

    Search your lockfiles and build artifacts for date-fns-formatter (4 malicious versions).

  2. If you installed it — respond

    date-fns-formatter is a typosquat — you almost certainly intended a legitimately-named package. Remove date-fns-formatter, 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 date-fns-formatter was installed, its post-install payload may already have run. Removing the package does not undo that — check outbound connections and credential use from the install window onward.

Frequently asked questions

No. date-fns-formatter on npm has been identified as a malicious package (versions 1.3.8, 1.3.9, 1.3.10, 1.4.9 flagged). It should be removed immediately — do not install or keep it in your dependency tree.

Campaign

GHSA-h258-m2gc-2p4qIN-MAL-2026-019685IN-MAL-2026-019681IN-MAL-2026-019683IN-MAL-2026-019682

References

Credits

  • Amazon Inspector · finder

Detect & block this

O3 blocks date-fns-formatter-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

date-fns-formatter (npm) malicious package — MAL-2026-15974 | O3 Security