Malicious code in unique-id-64 (npm)
--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (8ab3b19e4bd1602de93ca092a5909f8b69927c01d5a690d3484116024dfc46e2) Package impersonates the well-known sindresorhus/unique-string utility: package.json copies the author block (name 'Sindre Sorhus', email [email protected], homepage sindresorhus.com), repository field 'sindresorhus/unique-string', and README verbatim, despite not being published by that author. The default export, when invoked as uniqueString(64), AES-256-CBC-decrypts a hardcoded ciphertext (key derived from sha256('256-key')) and hands the plaintext to globalThis.eval, with 'eval' reconstructed obfuscation-style by joining the first letters of ['error','vertex','alphabetic','length']. Before reaching the eval branch, the code consults node-env-detector and short-circuits to a warning log when env.isCI || env.isNpmBot || env.isContainer || env.isVirtualMachineLikely is true — a deliberate sandbox/CI evasion gate so the hidden payload only fires on real developer or production hosts. The combination of identity-spoofed metadata, encrypted eval'd payload, and analysis-evasion gating is an unambiguous supply-chain attack: the installer cannot see what code runs, and the package's stated purpose (generate a unique string) does not require eval, AES decryption, or CI detection. ## Source: ghsa-malware (e07ae89bf61863621d92c76397d95dce54989d3274ba308f4a7773a8d419a353) Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.
AI Analysis
Technical Summary
The unique-id-64 package (version 1.0.0) impersonates the legitimate unique-string utility by copying author metadata and repository information. Its default export decrypts a hardcoded ciphertext using AES-256-CBC with a key derived from sha256('256-key') and executes the plaintext via eval, reconstructed through obfuscation. The code includes environment detection to avoid execution in CI, npm bots, containers, or likely virtual machines, indicating deliberate sandbox evasion. This behavior constitutes a supply-chain attack where the installed package executes hidden malicious code, potentially compromising the host system fully. The package's stated purpose does not justify the use of eval, AES decryption, or environment checks, confirming malicious intent. No patch or fix is available, and full compromise is possible.
Potential Impact
Any system with unique-id-64 version 1.0.0 installed or running should be considered fully compromised. The attacker may have gained full control, risking exposure of all secrets and keys on the system. Removal of the package alone may not eliminate all malicious components or backdoors introduced by the payload.
Mitigation Recommendations
There is no official patch or fix available for this malicious package. Immediate removal of unique-id-64 version 1.0.0 is required. All secrets and keys stored on the compromised system should be rotated from a separate, trusted environment. Due to the potential for persistent compromise, consider full system reimaging or forensic analysis to ensure complete remediation.
Malicious code in unique-id-64 (npm)
Description
--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (8ab3b19e4bd1602de93ca092a5909f8b69927c01d5a690d3484116024dfc46e2) Package impersonates the well-known sindresorhus/unique-string utility: package.json copies the author block (name 'Sindre Sorhus', email [email protected], homepage sindresorhus.com), repository field 'sindresorhus/unique-string', and README verbatim, despite not being published by that author. The default export, when invoked as uniqueString(64), AES-256-CBC-decrypts a hardcoded ciphertext (key derived from sha256('256-key')) and hands the plaintext to globalThis.eval, with 'eval' reconstructed obfuscation-style by joining the first letters of ['error','vertex','alphabetic','length']. Before reaching the eval branch, the code consults node-env-detector and short-circuits to a warning log when env.isCI || env.isNpmBot || env.isContainer || env.isVirtualMachineLikely is true — a deliberate sandbox/CI evasion gate so the hidden payload only fires on real developer or production hosts. The combination of identity-spoofed metadata, encrypted eval'd payload, and analysis-evasion gating is an unambiguous supply-chain attack: the installer cannot see what code runs, and the package's stated purpose (generate a unique string) does not require eval, AES decryption, or CI detection. ## Source: ghsa-malware (e07ae89bf61863621d92c76397d95dce54989d3274ba308f4a7773a8d419a353) Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.
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 unique-id-64 package (version 1.0.0) impersonates the legitimate unique-string utility by copying author metadata and repository information. Its default export decrypts a hardcoded ciphertext using AES-256-CBC with a key derived from sha256('256-key') and executes the plaintext via eval, reconstructed through obfuscation. The code includes environment detection to avoid execution in CI, npm bots, containers, or likely virtual machines, indicating deliberate sandbox evasion. This behavior constitutes a supply-chain attack where the installed package executes hidden malicious code, potentially compromising the host system fully. The package's stated purpose does not justify the use of eval, AES decryption, or environment checks, confirming malicious intent. No patch or fix is available, and full compromise is possible.
Potential Impact
Any system with unique-id-64 version 1.0.0 installed or running should be considered fully compromised. The attacker may have gained full control, risking exposure of all secrets and keys on the system. Removal of the package alone may not eliminate all malicious components or backdoors introduced by the payload.
Mitigation Recommendations
There is no official patch or fix available for this malicious package. Immediate removal of unique-id-64 version 1.0.0 is required. All secrets and keys stored on the compromised system should be rotated from a separate, trusted environment. Due to the potential for persistent compromise, consider full system reimaging or forensic analysis to ensure complete remediation.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-4781
- Osv Schema Version
- 1.7.4
- Aliases
- ["GHSA-wp6h-8x7v-865g"]
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a4c341227e9c797195f7c8d
Added to database: 07/06/2026, 23:02:42 UTC
Last enriched: 07/07/2026, 00:36:27 UTC
Last updated: 07/30/2026, 12:05:04 UTC
Views: 28
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.