Malicious code in date-fns-lite (npm)
The npm package 'date-fns-lite' versions 1.0.0 through 1.0.12 is a malicious package that masquerades as a lightweight date-formatting utility. It contains a postinstall script that executes automatically upon installation, harvesting sensitive credentials and configuration files from the host, including AWS, GCP, and Azure credentials, SSH keys, kubeconfig, /etc/shadow, and shell history. It also performs reconnaissance by querying cloud metadata services, enumerating Docker containers, and scanning the internal network. The collected data is sent to a hardcoded external IP address over unencrypted HTTP. This package poses a significant risk especially when installed in CI environments or containers with host filesystem mounts.
AI Analysis
Technical Summary
The 'date-fns-lite' npm package (versions 1.0.0 to 1.0.12) contains a malicious postinstall.js script that runs automatically during npm install. This script steals installer-side secrets such as cloud provider credentials (AWS, GCP, Azure), SSH private keys, kubeconfig, and sensitive system files like /etc/shadow and shell history by traversing the host filesystem via /proc/1/root from inside containers. It also queries cloud metadata endpoints for instance IAM credentials, probes the Docker socket to enumerate containers, and performs internal network reconnaissance including default gateway detection, ping sweeps, and port scanning on common service ports. The aggregated data is exfiltrated via an HTTP POST request to a hardcoded IP address (http://115.190.124.243:9082/callback). The package name mimics the legitimate 'date-fns' library to deceive users. The index.js file contains a plausible date formatter as a cover for the malicious payload.
Potential Impact
Installation of any affected version of 'date-fns-lite' leads to disclosure of sensitive credentials and system information to an attacker-controlled server. This includes cloud provider credentials that could allow unauthorized access to cloud resources, SSH keys enabling lateral movement, and internal network topology that facilitates further attacks. The compromise can lead to full cloud environment takeover, data exfiltration, and persistent access. The malicious behavior activates automatically on installation, requiring no additional user interaction.
Mitigation Recommendations
No official patch or remediation is currently available for 'date-fns-lite'. Users and organizations should avoid installing this package entirely. Verify dependencies carefully to ensure 'date-fns-lite' is not included transitively. Remove any instances of this package from existing environments. Monitor for suspicious network traffic to the indicated IP address. Since this is a malicious package, remediation involves removing the package and rotating any potentially compromised credentials. Patch status is not yet confirmed — check vendor advisories or trusted sources for updates.
Malicious code in date-fns-lite (npm)
Description
The npm package 'date-fns-lite' versions 1.0.0 through 1.0.12 is a malicious package that masquerades as a lightweight date-formatting utility. It contains a postinstall script that executes automatically upon installation, harvesting sensitive credentials and configuration files from the host, including AWS, GCP, and Azure credentials, SSH keys, kubeconfig, /etc/shadow, and shell history. It also performs reconnaissance by querying cloud metadata services, enumerating Docker containers, and scanning the internal network. The collected data is sent to a hardcoded external IP address over unencrypted HTTP. This package poses a significant risk especially when installed in CI environments or containers with host filesystem mounts.
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The 'date-fns-lite' npm package (versions 1.0.0 to 1.0.12) contains a malicious postinstall.js script that runs automatically during npm install. This script steals installer-side secrets such as cloud provider credentials (AWS, GCP, Azure), SSH private keys, kubeconfig, and sensitive system files like /etc/shadow and shell history by traversing the host filesystem via /proc/1/root from inside containers. It also queries cloud metadata endpoints for instance IAM credentials, probes the Docker socket to enumerate containers, and performs internal network reconnaissance including default gateway detection, ping sweeps, and port scanning on common service ports. The aggregated data is exfiltrated via an HTTP POST request to a hardcoded IP address (http://115.190.124.243:9082/callback). The package name mimics the legitimate 'date-fns' library to deceive users. The index.js file contains a plausible date formatter as a cover for the malicious payload.
Potential Impact
Installation of any affected version of 'date-fns-lite' leads to disclosure of sensitive credentials and system information to an attacker-controlled server. This includes cloud provider credentials that could allow unauthorized access to cloud resources, SSH keys enabling lateral movement, and internal network topology that facilitates further attacks. The compromise can lead to full cloud environment takeover, data exfiltration, and persistent access. The malicious behavior activates automatically on installation, requiring no additional user interaction.
Mitigation Recommendations
No official patch or remediation is currently available for 'date-fns-lite'. Users and organizations should avoid installing this package entirely. Verify dependencies carefully to ensure 'date-fns-lite' is not included transitively. Remove any instances of this package from existing environments. Monitor for suspicious network traffic to the indicated IP address. Since this is a malicious package, remediation involves removing the package and rotating any potentially compromised credentials. Patch status is not yet confirmed — check vendor advisories or trusted sources for updates.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-6722
- Osv Schema Version
- 1.7.4
- Aliases
- []
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a46ed1627e9c79719447375
Added to database: 07/02/2026, 22:58:30 UTC
Last enriched: 07/07/2026, 00:57:36 UTC
Last updated: 07/31/2026, 07:59:44 UTC
Views: 53
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.