Malicious code in date-fns-sync (npm)
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
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-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.
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 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.
External Links
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.