Malicious code in tiny-folder-tree (npm)
Description
The tiny-folder-tree npm package version 0.1.0 contains malicious code in its postinstall script that executes arbitrary shell commands on the installer's machine. This occurs by performing a DNS TXT record lookup and, based on the response, fetching and executing attacker-controlled code via an obfuscated HTTPS request. The malicious code is designed to evade detection and does not execute on the author's own host, indicating targeted exploitation of other users.
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 [email protected] package includes a postinstall script (src/build.js) that runs automatically during npm install. This script performs a DNS TXT lookup for spreadsheets-documents.com and checks if the first character of the first TXT record is '1'. If so, it invokes src/tools.js, which makes an HTTPS request to a dynamically reconstructed URL derived from obfuscated constants. The response header 'm' is passed directly to child_process.execSync, allowing arbitrary shell command execution controlled by an attacker. The code uses obfuscation techniques to evade static analysis, including reconstructing the HTTPS module require target and the destination URL. Additionally, the script bypasses execution on the author's host by checking for the username 'justin', confirming the malicious intent is to target other users.
Potential Impact
This vulnerability allows arbitrary code execution on any system that installs [email protected], potentially leading to full system compromise, data theft, or further malware deployment. The attack is triggered during package installation, which is a common operation, increasing the risk of widespread impact if the package is used.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should avoid installing tiny-folder-tree version 0.1.0. If already installed, remove the package and audit affected systems for signs of compromise. Monitor official advisories for updates or patches. Since this is a malicious package, consider using package integrity verification tools and restrict installation of untrusted packages.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-15907
- Osv Schema Version
- 1.7.4
- Ecosystems
- ["npm"]
Threat ID: 6a9ad4edacd9273b49b6781e
Added to database: 09/04/2026, 14:25:49 UTC
Last enriched: 09/07/2026, 16:24:19 UTC
Last updated: 10/04/2026, 06:35:30 UTC
Views: 23
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.