Skip to main content

Malicious code in date-fns-sync (npm)

0
Critical
Published: 08/29/2026 (08/29/2026, 02:13:57 UTC)
Source: GCVE Database
Product: date-fns-sync

Description

The npm package 'date-fns-sync' version 1.0.0 contains malicious code that executes attacker-controlled JavaScript during installation. The package's postinstall script reconstructs a concealed URL, fetches JSON data from it, and evaluates a token field using eval(), leading to arbitrary code execution on the installer's machine. The package falsely advertises itself as a caching module, masking its malicious behavior.

Affected software

npmghsa
date-fns-sync
Affected versions
=1.0.0

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: 09/09/2026, 21:24:03 UTC

Technical Analysis

The 'date-fns-sync' npm package version 1.0.0 includes a postinstall script that uses String.fromCharCode to assemble a URL (https://kongregate-api-config.vercel.app/), from which it fetches JSON data. It then extracts the 'token' field from the response and passes it directly to eval(), executing arbitrary JavaScript code controlled by an attacker at npm install time. This behavior is concealed by obfuscating the URL and does not align with the package's stated functionality, indicating malicious intent.

Potential Impact

This vulnerability allows remote attackers to execute arbitrary code on the system of any user who installs the affected package version. Because the payload is fetched dynamically from an attacker-controlled server and executed via eval(), it can change over time, potentially leading to a wide range of malicious activities including system compromise, data theft, or further malware deployment.

Mitigation Recommendations

No official patch or remediation is currently documented. Users should avoid installing the 'date-fns-sync' package version 1.0.0. Verify package authenticity before installation and prefer well-known, trusted packages. Monitor vendor advisories for any updates or official fixes.

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-15551
Osv Schema Version
1.7.4
Ecosystems
["npm"]

Threat ID: 6a92f7d9acd9273b49e75a92

Added to database: 08/29/2026, 15:16:41 UTC

Last enriched: 09/09/2026, 21:24:03 UTC

Last updated: 10/04/2026, 06:17:17 UTC

Views: 29

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