Skip to content
supplychainattack.orgSupply chain attack incident catalog
resolvedcritical

Malicious code in chai-tracker (npm)

chai-tracker, a malicious npm package impersonating chai-spies, executes arbitrary code from an attacker-controlled dependency (dbconnectify) at plugin load time. The malicious code is disguised within the chai plugin initialization and runs in a detached child process with suppressed output.

ShareXLinkedInHacker News
Disclosed
Last updated
Blast radius
All npm consumers of chai-tracker package
Ecosystems
Attack vectors
Affected entities
  • chai-trackerMalicious npm package mimicking chai-spies

chai-tracker is a malicious npm package designed to mimic the legitimate chai-spies library, using matching names, README content, and keywords to deceive users. The package declares a peer dependency on dbconnectify pinned to 'latest' and axios.

When the chai plugin is loaded via chai.use(require('chai-tracker')), the package executes a hidden function called assertConnection() that is placed between legitimate Assertion.overwriteMethod definitions to evade detection. Despite its name suggesting an assertion operation, this function spawns a detached child process that executes arbitrary code.

The child process loads the attacker-controlled dbconnectify package and instantiates a DxDatabaseConnector object, calling its queryDBConnect() method. Because dbconnectify is unversioned ('latest') and controlled by the attacker, arbitrary code executes on the installer's machine at plugin load time. The detached process with ignored stdio ensures output is suppressed, hiding the malicious activity.

This attack combines typosquatting/impersonation with dependency confusion and code execution at install/load time, affecting any system that installs and uses the chai-tracker package.

Indicators of compromise

Packages
  • chai-tracker

Remediation

  • Immediately remove chai-tracker from all projects and dependencies
  • Audit npm package.json and lock files for any presence of chai-tracker
  • If chai-spies is the intended dependency, verify installation of the legitimate chai-spies package from the correct maintainer
  • Review system logs and process execution history on machines where chai-tracker was installed for signs of unauthorized activity
  • Regenerate any credentials or secrets that may have been exposed on affected systems
  • Monitor for suspicious network connections or data exfiltration from affected hosts

Sources

  1. GitHub Advisory GHSA-j2r4-fv2p-jjf8 · GitHub Advisory Database

Cite this entry

"Malicious code in chai-tracker (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed August 10, 2026; last updated August 10, 2026. https://supplychainattack.org/incident/malicious-code-in-chai-tracker-npm-ri3t6d

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 stillm4ddpocs-demo-sprocket (npm)

    The npm package stillm4ddpocs-demo-sprocket version 999.9.12 contains malicious code that exfiltrates system and project metadata via multiple channels (HTTPS, HTTP, and DNS) to a hardcoded callback host. The package uses a high version number to exploit dependency-confusion attacks against organizations with internal packages of the same name.

    npmCompromised packageDependency confusion
  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 lumen-pages-community (npm)

    lumen-pages-community@9.9.9 on npm contains malicious code that executes a postinstall hook to exfiltrate installer metadata (hostname, username, working directory, platform, Node version, CI environment, npm user-agent) to a hardcoded webhook.site URL. The high version number and lack of functionality suggest a dependency-confusion attack.

    npmCompromised packageDependency confusion
  4. resolvedcritical

    Malicious code in @gfe/lx-watcher (npm)

    The npm package @gfe/lx-watcher contained malicious code that exfiltrated host metadata (hostname, OS username, working directory, timestamp) via npm lifecycle hooks to a hardcoded webhook.site endpoint. The package exploited dependency confusion by using a scoped name (@gfe/*) with a no-op stub, allowing silent resolution against the public registry while leaking host identifiers.

    npmDependency confusionCompromised package