Skip to content
supplychainattack.orgSupply chain attack incident catalog
resolvedcritical

Malicious code in mutex-core (npm)

The npm package mutex-core, published under a name resembling the popular async-mutex library, contained malicious code including a staged loader that decrypts and executes hidden payloads. The package included obfuscated code that conditionally triggers AES-256-GCM decryption and execution of encrypted binary content when specific conditions are met.

ShareXLinkedInHacker News
Disclosed
Last updated
Blast radius
All consumers of the mutex-core npm package
Ecosystems
Attack vectors
Affected entities
  • mutex-corenpm package masquerading as async-mutex

The npm package mutex-core was published as a typosquatting variant of the legitimate async-mutex library. Beyond its advertised mutex functionality, the package contained a staged loader mechanism embedded in lib/Mutex.js.

The malicious behavior is triggered in the Mutex.prototype.runExclusive method, which checks whether a callback's meta.jobId hashes to a hardcoded SHA256 digest (b7e54f328f8b2298252479f2a357e13e23701227d1f990a15c598a74c3de5fe5). Upon match, the code invokes a decryption routine from lib/common.js to AES-256-GCM-decrypt the sibling file lib/withMutex.min.js—a ~17KB base64-encoded literal that decodes to ~12.7KB of opaque encrypted bytes—using key material derived from scryptSync applied to the jobId. The decrypted plaintext is written to disk and executed via spawned node process with detached stdio, all wrapped in exception handling.

The lib/common.js file is string-array-obfuscated (numeric-indexed lookup with rotation) and serves only the decrypt-and-drop functionality; it is not referenced by any legitimate mutex behavior. The encrypted payload contents remain opaque to package consumers, making the executed code invisible to inspection.

The incident was identified and credited to the OpenSSF's malicious-packages repository.

Indicators of compromise

Packages
  • mutex-core
Hashes
  • b7e54f328f8b2298252479f2a357e13e23701227d1f990a15c598a74c3de5fe5

Remediation

  • Immediately remove mutex-core from all dependencies and package-lock files
  • Audit all systems that installed mutex-core for signs of unauthorized code execution or persistence mechanisms
  • Replace mutex-core with the legitimate async-mutex package
  • Review npm audit logs and CI/CD logs for any execution of mutex-core during the period it was installed
  • Consider rotating credentials and secrets on any systems where mutex-core was installed, as the encrypted payload may have exfiltrated sensitive data

Sources

  1. GitHub Advisory GHSA-94q2-wjj8-835j · GitHub Advisory Database

Cite this entry

"Malicious code in mutex-core (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed August 19, 2026; last updated August 19, 2026. https://supplychainattack.org/incident/malicious-code-in-mutex-core-npm-1z0975

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 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
  2. 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
  3. 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
  4. 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