envfile-sync-cli@1.0.2
Malicious code in envfile-sync-cli (npm)
Analysis
Package advertises itself as a zero-dependency .env-to-.env.example sync/validation CLI, and indeed ships a complete pure-JavaScript .env parser that does all of the advertised work. Hidden at the end of its main module (src/index.js) is a module-load-time block that resolves bin/native/parser.node and calls process.dlopen on it inside a nested try/catch that silently swallows every error and discards the result. The comment claims this is a native parser loaded for performance, but the parser is implemented entirely in JavaScript and the loaded binary is never used. The bundled bin/native/parser.node is not a Node native addon at all but a Windows PE executable, so on Windows simply importing the package (or running its CLI) loads and executes attacker-controlled native code with no further interaction. The package was freshly published from a disposable email account and stuffed with dotenv/env-sync keywords to attract installs.
- analyzed by
- Leitwacht
- first seen
- Jun 17, 2026, 02:24 AM
- analyzed
- Jun 17, 2026, 02:28 AM
- weekly installs
- 228
Related advisories
- chai-utils-test@4.5.1
- chai-utils-test@4.5.0
- dotenv-pack@2.3.7
- dotenv-pack@2.3.10
- chai-as-init@1.4.6
- jsf-utils@1.3.1
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.