Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

Malicious code in date-fns-lite (npm)

0
Critical
Published: 07/01/2026 (07/01/2026, 12:21:14 UTC)
Source: GCVE Database
Product: date-fns-lite

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

npmghsa
date-fns-lite
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

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

AILast updated: 07/07/2026, 00:57:36 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses