Supply-chain threat intelligence

Incident detail

criticalnpm·credential theft·osv

Malicious code in date-fns-lite (npm)

date-fns-lite

Risk score

92

AI summary

Indexed incident for date-fns-lite (npm).

Description

date-fns-lite@1.0.10 presents as a lightweight date-formatting utility but ships a malicious postinstall.js that runs automatically on npm install. The script harvests installer-side secrets — AWS credentials (~/.aws), GCP application-default credentials, Azure tokens, kubeconfig, SSH private keys and authorized_keys, /etc/shadow, and shell history — using /proc/1/root traversal to reach the host filesystem from inside a container. It also queries the AWS IMDS endpoint (http://169.254.169.254/latest/meta-data/iam/security-credentials/) and GCP metadata service for instance IAM credentials, probes the Docker socket via /proc/1/root/var/run/docker.sock to enumerate containers, and performs internal-network reconnaissance (default-gateway detection, /24 ping sweep, port probes on 22/80/443/3306/6379/9200/27017). The aggregated report is POSTed to a hardcoded bare-IP endpoint at http://115.190.124.243:9082/callback over plain HTTP. The package name mimics the widely-used date-fns library, and index.js contains a small plausible-looking date formatter as cover for the postinstall payload. Installing this package on any host — especially in CI or a container with host mounts — will disclose cloud credentials, SSH keys, and an internal-network map to the attacker.

Technical details

Affected versions

=1.0.5=1.0.9=1.0.11=1.0.0=1.0.1=1.0.6=1.0.10=1.0.8=1.0.2=1.0.7=1.0.3=1.0.12=1.0.4

Indicators

  • affected version=1.0.575%
  • affected version=1.0.975%
  • affected version=1.0.1175%
  • affected version=1.0.075%
  • affected version=1.0.175%
  • affected version=1.0.675%
  • affected version=1.0.1075%
  • affected version=1.0.875%
  • affected version=1.0.275%
  • affected version=1.0.775%
  • affected version=1.0.375%
  • affected version=1.0.1275%
  • affected version=1.0.475%

Timeline

  1. Advisory published
  2. Indexed by ThreatPkg

Related incidents