Malicious code in electron-sessions (npm)
The npm package electron-sessions contained malicious obfuscated code designed to exfiltrate Electron/Chromium session data (cookies, Local Storage, Login Data) to an attacker-controlled Vercel Blob endpoint. The package masqueraded as a legitimate session utilities library but shipped a 1.18MB obfuscated bundle with no legitimate functionality.
- Disclosed
- Last updated
- Blast radius
- Any developer or system that installed or executed the electron-sessions package
- Ecosystems
- Attack vectors
- Affected entities
- electron-sessionsnpm package containing malicious obfuscated code
The npm package electron-sessions was published with malicious intent, advertising itself as generic session utilities while containing heavily obfuscated JavaScript code (javascript-obfuscator with control-flow flattening, self-defending wrapper, and dead-code injection). The obfuscated bundle served as both the main entry point and binary executable.
The malicious code targets Electron and Chromium session artifacts including cookies, Local Storage, leveldb databases, and Login Data. It imports the @vercel/blob SDK (version ^2.6.1) to upload collected data to a Vercel Blob store controlled by the attacker via a BLOB_READ_WRITE_TOKEN. The package's README provided only a minimal cover-story API with no documentation of upload functionality or configurable destination.
Any process executing npx electron-sessions or requiring the module would trigger the obfuscated payload against the host system, exfiltrating sensitive session data to the attacker's infrastructure. The attack was discovered and reported by the OpenSSF malicious packages project.
Indicators of compromise
- Packages
- electron-sessions
Remediation
- Immediately uninstall the electron-sessions package from all systems
- Audit npm install logs to identify all systems that may have installed this package
- Assume compromise of any Electron/Chromium session data (cookies, credentials, Local Storage) on affected systems
- Rotate credentials and session tokens for any accounts accessed through affected systems
- Review Vercel Blob access logs if you control any Blob stores to detect unauthorized access
- Use npm audit to check for this package in dependency trees
- Consider using npm package signing verification and supply chain security tools to prevent similar attacks
Sources
- GitHub Advisory GHSA-hfwf-h9c6-hx32 · GitHub Advisory Database
Cite this entry
"Malicious code in electron-sessions (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed August 19, 2026; last updated August 19, 2026. https://supplychainattack.org/incident/malicious-code-in-electron-sessions-npm-vnucin
Suggest a correction
Found an error or have a newer source? Corrections to factual errors take priority over new entries.
Related incidents
- containedcritical
Malicious code in 3-buildsight-web (npm)
The npm package 3-buildsight-web contains malicious code that fetches and executes arbitrary JavaScript from a remote Bitbucket URL on module load, granting full page privileges to an unverified third party.
npmCompromised package - resolvedcritical
Malicious code in @usaa-grp-personal-profile/personal-profile-common (npm)
Malicious package @usaa-grp-personal-profile/personal-profile-common version 999.0.0 published to public npm as a dependency-confusion attack targeting an organization's internal registry. The package contains preinstall and postinstall hooks that exfiltrate hostname, username, and working directory to an attacker-controlled OAST endpoint on every install.
npmDependency confusionCompromised package - resolvedcritical
Malicious code in create-coin (npm)
create-coin@20.1.1 on npm contained malicious postinstall code that collected sensitive environment variables, credentials, and host reconnaissance data. The package impersonated an esbuild platform build and exfiltrated data to a hardcoded endpoint.
npmCompromised packageTyposquatting - resolvedcritical
Malicious code in @syncraft-labs/vue (npm)
The npm package @syncraft-labs/vue version 0.4.1 contained malicious obfuscated code in its ESM build that implements a blockchain-hosted C2 dropper (EtherHiding pattern), enabling remote code execution on any consumer importing the package.
npmCompromised package