Skip to content
supplychainattack.orgSupply chain attack incident catalog
resolvedcritical

Malicious code in datefmt-core-utils (npm)

The npm package datefmt-core-utils contained malicious code in a postinstall.js script that executes automatically on installation, establishing a reverse shell to a remote IP address (8.135.48.40:4444). The package masqueraded as a date-formatting utility while delivering a backdoor payload.

ShareXLinkedInHacker News
Disclosed
Last updated
Blast radius
All npm users who installed datefmt-core-utils
Ecosystems
Attack vectors
Affected entities
  • datefmt-core-utilsnpm package containing malicious postinstall script

The npm package datefmt-core-utils was published with malicious code embedded in a postinstall.js script. This script is automatically executed by npm during package installation via the scripts.postinstall hook, without requiring explicit user action.

The postinstall.js payload establishes a TCP connection to a hardcoded remote address (8.135.48.40:4444) and redirects /bin/bash stdio to that socket, granting the attacker an interactive shell on the victim's machine. The malicious script implements three redundant methods to achieve this: Python 3 pty.spawn, Python 3 subprocess, and Node.js net combined with child_process.spawn of '/bin/bash -i'.

The package's legitimate index.js file contained functional date-formatting code, serving as a cover story to evade detection. The malicious behavior was discovered and reported through the OpenSSF's malicious-packages repository.

This incident demonstrates the risk of postinstall scripts in npm packages, which execute with the privileges of the installing user and can perform arbitrary system operations before the package is even used.

Indicators of compromise

Packages
  • datefmt-core-utils
IPs
  • 8.135.48.40

Remediation

  • Immediately uninstall datefmt-core-utils from all systems
  • Audit system logs and network connections for evidence of compromise or reverse shell activity to 8.135.48.40:4444
  • Rotate credentials and SSH keys on any affected machines
  • Review npm audit logs to identify when the package was installed
  • Consider using npm's --ignore-scripts flag for untrusted packages or implementing package verification policies
  • Monitor for similar malicious packages using OpenSSF's malicious-packages database

Sources

  1. GitHub Advisory GHSA-xfhg-hjhp-c7c6 · GitHub Advisory Database

Cite this entry

"Malicious code in datefmt-core-utils (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed August 14, 2026; last updated August 14, 2026. https://supplychainattack.org/incident/malicious-code-in-datefmt-core-utils-npm-1yraay

Suggest a correction

Found an error or have a newer source? Corrections to factual errors take priority over new entries.

  1. containedcritical

    Malicious code in 3-buildsight-web (npm)

    The npm package 3-buildsight-web contains malicious code that fetches and executes arbitrary JavaScript from a remote Bitbucket URL on module load, granting full page privileges to an unverified third party.

    npmCompromised package
  2. resolvedcritical

    Malicious code in @usaa-grp-personal-profile/personal-profile-common (npm)

    Malicious package @usaa-grp-personal-profile/personal-profile-common version 999.0.0 published to public npm as a dependency-confusion attack targeting an organization's internal registry. The package contains preinstall and postinstall hooks that exfiltrate hostname, username, and working directory to an attacker-controlled OAST endpoint on every install.

    npmDependency confusionCompromised package
  3. resolvedcritical

    Malicious code in create-coin (npm)

    create-coin@20.1.1 on npm contained malicious postinstall code that collected sensitive environment variables, credentials, and host reconnaissance data. The package impersonated an esbuild platform build and exfiltrated data to a hardcoded endpoint.

    npmCompromised packageTyposquatting
  4. resolvedcritical

    Malicious code in @syncraft-labs/vue (npm)

    The npm package @syncraft-labs/vue version 0.4.1 contained malicious obfuscated code in its ESM build that implements a blockchain-hosted C2 dropper (EtherHiding pattern), enabling remote code execution on any consumer importing the package.

    npmCompromised package