Skip to content
supplychainattack.orgSupply chain attack incident catalog
containedcritical

Malicious code in modsync (npm)

The npm package modsync contains malicious obfuscated code that executes at require-time. The package masquerades as a pino-like logger but exports a no-op middleware while loading a 4 MB obfuscated payload from ./lib/config that runs unconditionally when the module is imported.

ShareXLinkedInHacker News
Disclosed
Last updated
Blast radius
Any npm consumer of the modsync package
Ecosystems
Attack vectors
Affected entities
  • modsyncnpm package with malicious obfuscated code

The npm package modsync was identified as malicious by Amazon Inspector and the OpenSSF malicious-packages project. The package presents a deceptive cover story, copying README, documentation, and TypeScript definitions from the legitimate pinojs/pino project and using logger-related keywords (fast, logger, stream, json) to appear legitimate.

However, the exported middleware is a no-op. Instead, index.js unconditionally requires ./lib/config, which is a 4 MB single-line file containing heavily obfuscated code with characteristic obfuscator.io fingerprints: hex-named identifiers, a ~23,909-entry rotating string array, decoder functions, control-flow flattening, and hex string escapes. This obfuscated code executes via a top-level IIFE (immediately-invoked function expression) at module load time.

Any consumer that imports modsync will execute the obfuscated payload in their process. The package metadata is inconsistent with its advertised purpose—the name modsync combined with pino keywords and a description referencing vulnerability management, along with a suspicious bugs URL (jsonspack.com/issues), further indicate malicious intent. The combination of plagiarized documentation, a no-op public API, and a large obfuscated require-time payload is characteristic of a supply chain attack designed to hide malicious behavior from inspection.

Indicators of compromise

Packages
  • modsync

Remediation

  • Immediately remove modsync from all dependencies and lock files
  • Audit all projects that have installed modsync for unexpected behavior or data exfiltration
  • Review npm audit logs and package-lock.json files to identify when modsync was installed
  • Regenerate any credentials or secrets that may have been exposed to processes running modsync
  • Update to a patched version if available, or use an alternative legitimate logging package such as pino or winston

Sources

  1. GitHub Advisory GHSA-6f95-rcfm-53r3 · GitHub Advisory Database

Cite this entry

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

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