Malicious code in greensaver (npm)
--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (dd840e550f39e1f29f7a50b0cd121c3fa5e78e99954f22009f03b5ac775f91ec) [email protected] declares a postinstall script ("node lib/greensaver.js") that runs automatically on `npm install`. The script decodes two files masquerading as TypeScript sourcemaps (lib/parse.ts.map and lib/init.ts.map) from base64 into sibling JavaScript files (lib/parsetmp.js and lib/config.js), requires the loader, and then unlinks all four files to erase evidence. The loader fetches an AES-CBC-encrypted blob from https://www.jsonkeeper.com/b/V6NBX (an anonymous JSON paste host), decrypts it with the hardcoded password 'myPassword123', and passes the resulting plaintext directly to eval(). The endpoint URL and auth header values are additionally base64-wrapped for a second obfuscation layer. The remainder of the package (scan.js, parse.js, constants.js, utils.js, and the exported makeRe/scan/parse API) is a rename of the picomatch glob-matcher library, providing a cover story for the dropper. The package name and 'Blazing fast and accurate glob matcher' description resemble picomatch.
AI Analysis
Technical Summary
The 'greensaver' npm package declares a postinstall script that runs automatically on installation. This script decodes two base64-encoded files disguised as TypeScript sourcemaps into JavaScript, loads a loader module, and then deletes all four files to erase traces. The loader fetches an AES-CBC-encrypted payload from an anonymous JSON paste host, decrypts it using a hardcoded password ('myPassword123'), and executes the decrypted code via eval(). The package's remaining code is a renamed version of the legitimate picomatch glob-matcher library, serving as a cover for the malicious dropper functionality.
Potential Impact
Users installing affected versions of the 'greensaver' package risk executing arbitrary code fetched and decrypted at install time, potentially leading to system compromise or further malicious activity. The malicious payload is dynamically retrieved and executed, making detection and prevention more difficult.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should avoid installing or using the 'greensaver' package versions 1.2.1, 1.2.2, and 1.2.3. Consider removing these versions from projects and replacing them with trusted alternatives. Monitor for vendor advisories for updates or fixes.
Malicious code in greensaver (npm)
Description
--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (dd840e550f39e1f29f7a50b0cd121c3fa5e78e99954f22009f03b5ac775f91ec) [email protected] declares a postinstall script ("node lib/greensaver.js") that runs automatically on `npm install`. The script decodes two files masquerading as TypeScript sourcemaps (lib/parse.ts.map and lib/init.ts.map) from base64 into sibling JavaScript files (lib/parsetmp.js and lib/config.js), requires the loader, and then unlinks all four files to erase evidence. The loader fetches an AES-CBC-encrypted blob from https://www.jsonkeeper.com/b/V6NBX (an anonymous JSON paste host), decrypts it with the hardcoded password 'myPassword123', and passes the resulting plaintext directly to eval(). The endpoint URL and auth header values are additionally base64-wrapped for a second obfuscation layer. The remainder of the package (scan.js, parse.js, constants.js, utils.js, and the exported makeRe/scan/parse API) is a rename of the picomatch glob-matcher library, providing a cover story for the dropper. The package name and 'Blazing fast and accurate glob matcher' description resemble picomatch.
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 'greensaver' npm package declares a postinstall script that runs automatically on installation. This script decodes two base64-encoded files disguised as TypeScript sourcemaps into JavaScript, loads a loader module, and then deletes all four files to erase traces. The loader fetches an AES-CBC-encrypted payload from an anonymous JSON paste host, decrypts it using a hardcoded password ('myPassword123'), and executes the decrypted code via eval(). The package's remaining code is a renamed version of the legitimate picomatch glob-matcher library, serving as a cover for the malicious dropper functionality.
Potential Impact
Users installing affected versions of the 'greensaver' package risk executing arbitrary code fetched and decrypted at install time, potentially leading to system compromise or further malicious activity. The malicious payload is dynamically retrieved and executed, making detection and prevention more difficult.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should avoid installing or using the 'greensaver' package versions 1.2.1, 1.2.2, and 1.2.3. Consider removing these versions from projects and replacing them with trusted alternatives. Monitor for vendor advisories for updates or fixes.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-16138
- Osv Schema Version
- 1.7.4
- Ecosystems
- ["npm"]
Threat ID: 6aa49fe555bf5e2cf5a7d7b3
Added to database: 09/12/2026, 00:42:13 UTC
Last enriched: 09/12/2026, 00:43:57 UTC
Last updated: 09/12/2026, 01:19:38 UTC
Views: 4
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.