Skip to content
supplychainattack.orgSupply chain attack incident catalog
resolvedcritical

Malicious code in encrypt-string-safe (npm)

The npm package encrypt-string-safe contains malicious obfuscated code that fetches and executes attacker-controlled JavaScript from a lookalike CDN (npm.jsdelivree.com) via plain HTTP. Any invocation of the package's exported APIs triggers remote code execution in the caller's process.

ShareXLinkedInHacker News
Disclosed
Last updated
Blast radius
Any consumer importing encrypt-string-safe and invoking its documented APIs
Ecosystems
Attack vectors
Affected entities
  • encrypt-string-safenpm package with malicious code

The npm package encrypt-string-safe was found to contain heavily obfuscated malicious code. All exported APIs (loadEncryptString, attachEncryptPlain, handleEncryptResponse, encryptStringAdmin, getEncryptStringAdmin, decryptStringAdmin) route through an internal ensureCore() function that fetches JavaScript from http://npm.jsdelivree.com/encrypt-string-admin-core/core.js and executes it in-process using new Function().

The attack leverages multiple obfuscation and deception techniques: the destination hostname is a lookalike of the legitimate jsdelivr CDN (jsdelivree.com vs. jsdelivr.net), the URL is delivered via obfuscated string-array decoding, transport uses plain HTTP without TLS, and integrity verification relies only on a marker-string search. This obfuscation conceals the malicious behavior from casual code review.

Any consumer that imports the package and invokes its documented APIs will trigger the fetching and execution of attacker-controlled code from a mutable third-party host, resulting in arbitrary code execution in the caller's process. The incident was identified and credited to the OpenSSF malicious-packages project.

Indicators of compromise

Packages
  • encrypt-string-safe
Domains
  • npm.jsdelivree.com

Remediation

  • Remove encrypt-string-safe from all dependencies immediately
  • Audit all systems that imported or executed encrypt-string-safe for signs of compromise
  • Review process execution logs and network connections from affected systems during the period the package was installed
  • Regenerate any credentials or secrets that may have been exposed
  • Update to a safe alternative cryptographic library
  • Implement package integrity verification and supply chain security scanning in your dependency management process

Sources

  1. GitHub Advisory GHSA-j2gm-44wq-32jv · GitHub Advisory Database

Cite this entry

"Malicious code in encrypt-string-safe (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed August 5, 2026; last updated August 5, 2026. https://supplychainattack.org/incident/malicious-code-in-encrypt-string-safe-npm-1g2ebx

Suggest a correction

Found an error or have a newer source? Corrections to factual errors take priority over new entries.

  1. containedcritical

    Malicious code in pfp-forms-sme-loan (npm)

    The npm package pfp-forms-sme-loan contains malicious code that executes a hidden loader on import, downloading and running platform-specific native payloads from attacker-controlled Cloudflare Workers hosts or reconstructing them via DNS TXT records under well1.site. Any system that imported this package should be considered compromised.

    npmCompromised packageMalicious commit
  2. containedcritical

    Malicious code in @wololasod/tiny-id (npm)

    The npm package @wololasod/tiny-id contained obfuscated malicious code that downloads and executes platform-specific remote executables on Windows and Linux systems. The dropper was embedded in both the main entry point (dist/index.cjs) and the TypeScript types file (dist/index.d.ts), disguised as a tiny ID generator.

    npmCompromised packageMalicious commit
  3. resolvedcritical

    Malicious code in @velliajs/discord (npm)

    @velliajs/discord, a malicious npm package masquerading as a discord.js clone, contained two hostile mechanisms: an unpinned private git dependency with embedded GitHub PAT enabling arbitrary code injection on install, and a hidden runtime kill-switch that gates bot functionality based on a remote allow-list. Two live GitHub Personal Access Tokens were hardcoded in the package.

    npmCompromised packageMalicious commit
  4. resolvedcritical

    Malicious code in akamaijs-sensorv1 (npm)

    The npm package akamaijs-sensorv1, which advertises itself as an Akamai Bot Manager sensor generator, contains malicious code that executes hidden dynamic code and fetches remote instructions from a Google Calendar-based command-and-control channel. The package uses invisible Unicode characters to conceal executable code and establishes a covert remote-code execution sink controlled by an attacker-owned email account.

    npmCompromised packageMalicious commit