electron-device-id@1.0.3
Malicious code in electron-device-id (npm)
Analysis
This release (index.js, javascript-obfuscator string-array form) adds a remote code download-and-execute path on top of the machine-id/license-gate base. In its checkData() routine it atob-decodes a hardcoded HTTPS endpoint (host begins hxxps://api[.]npo[.][.]. , assembled from split base64 fragments), fetches JSON from it, base64-decodes the response "dd" field, JSON-parses it, and when the object field a matches an expected marker it builds new Function(obj.b) and immediately invokes it, executing attacker-supplied JavaScript. It also installs cookie-based persistence: setData()/getData() write and read values via document.cookie with an expiry, and a document DOMContentLoaded handler runs (after a 1s setTimeout) getData()->checkData() to fetch and execute on every page load in a browser/Electron context. require strings (child_process, crypto) and the endpoint are split-concatenated to evade static analysis. Concrete IOC: remotely fetched JS executed via new Function from a base64-hidden hxxps://api[.]npo[.][.]. endpoint.
- analyzed by
- Leitwacht
- first seen
- Jun 1, 2026, 08:13 PM
- analyzed
- Jun 1, 2026, 08:32 PM
Related advisories
- sensivity@2.5.24
- sensivity@2.5.23
- @gbrlxvi/ts-form-utils@2.1.1
- sensivity@2.5.3
- sensivity@2.5.2
- sensivity@2.5.0
- argoncrypt@1.2.3
- chai-as-patched@7.0.6
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.