# GHSA-J2R4-FV2P-JJF8: Malicious code in chai-tracker (npm)

- Database: GitHub
- Malicious package: yes
- Published: 2026-08-10
- Modified: 2026-09-04

## Affected versions

- chai-tracker (npm): 1.2.1
- chai-tracker (npm): 1.1.0
- chai-tracker (npm): 1.1.1
- chai-tracker (npm): 1.1.2
- chai-tracker (npm): 1.1.3

## Description

## Source: amazon-inspector (d61869c26ad8015b88350d312fa37f5e18d536794ce5d8c46bf4239b2154b1a9)
chai-tracker mimics chai-spies (matching name, README, and keywords) but declares peerDependencies on dbconnectify pinned to 'latest' and axios. The exported chai plugin function, invoked when a consumer calls chai.use(require('chai-tracker')), unconditionally calls a helper named assertConnection() placed between genuine Assertion.overwriteMethod definitions. Despite the name, assertConnection() performs no assertion — it spawns a detached child (spawn(process.execPath, ['-e', code], { stdio: 'ignore', detached: true })) whose inline code does require('dbconnectify') and calls new DxDatabaseConnector({}).queryDBConnect(). Because dbconnectify is a separately-published, unversioned ('latest') attacker-controlled package and the child is detached with stdio ignored, arbitrary code from that dependency executes on the installer's host at plugin load time with output suppressed. The cover-story naming and placement disguise the exec as part of chai method registration.

---

Credit: [OpenSSF](https://github.com/ossf/malicious-packages) ([source](https://github.com/ossf/malicious-packages/blob/b41aabfe8f558a86ea4ee5161d362f4e75bb670d/osv/malicious/npm/chai-tracker/MAL-2026-13704.json))

## References

- https://github.com/ossf/malicious-packages/blob/b41aabfe8f558a86ea4ee5161d362f4e75bb670d/osv/malicious/npm/chai-tracker/MAL-2026-13704.json
- https://www.npmjs.com/package/chai-tracker/v/1.1.0
- https://www.npmjs.com/package/chai-tracker/v/1.1.1
- https://www.npmjs.com/package/chai-tracker/v/1.1.2
- https://www.npmjs.com/package/chai-tracker/v/1.1.3
- https://www.npmjs.com/package/chai-tracker/v/1.2.1
- https://github.com/ossf/malicious-packages/blob/4012598c9b06e58935bd8883f7a0cd37c3130664/osv/malicious/npm/chai-tracker/MAL-2026-13704.json
- https://github.com/advisories/GHSA-j2r4-fv2p-jjf8

Page: https://cve.now/GHSA-J2R4-FV2P-JJF8

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
