chai-as-forgeted
This report shows the evidence for chai-as-forgeted@9.24.6, the only known version.
This package appears in our research on the fake chai plugin campaign, with how it works, the full package list and what to do if you installed it.
OpenSSF/OSV Malicious Advisory
imported 4mo ago · by OpenSSF/OSVOpenSSF/OSV advisory MAL-2026-6219 confirms this npm version as malicious.
Advisory
MAL-2026-6219
Source
OpenSSF Malicious Packages via OSV
Summary
Malicious code in chai-as-forgeted (npm)
Details
Package name impersonates the popular chai-as-promised assertion library, but its package.json description and keywords are copied from pino and the code is unrelated to chai. The package's main entry exports a middleware factory that spawns lib/caller.js as a detached node child process. lib/caller.js base64-decodes a hardcoded URL pointing at api.jsonstorage.net (a mutable third-party JSON storage service), GETs the JSON document, extracts the `cookie` field, and executes its contents via `new Function.constructor('require', s)(require)` with full access to `require`. The C2 URL and request headers are stored as base64 strings inside a locally redefined `process` object that shadows the real process global, then decoded with `atob` at runtime. Any consumer who installs and invokes the exported middleware triggers arbitrary attacker-controlled code execution; the attacker can rotate the payload served by the JSON storage endpoint at will.
References
Source & flagged code
0 flagged · loading sourceNo flagged code excerpts are attached to this scan.
Findings
1 High
HighOsv Malicious Advisory
Affected versions and remediation
This report applies to chai-as-forgeted@9.24.6.
The versions list below shows the verdict for each recorded version.
- Avoid installing chai-as-forgeted@9.24.6. Remove it from direct dependencies and check your lockfile for transitive copies.
- Choose an independently verified alternative or release. This report does not establish that other versions are safe.
- If this version ran, investigate the affected machine and build environment. Rotate credentials it could access and rebuild from a trusted environment.
Evidence last updated: .
Source advisory published: .
This report uses published external intelligence. The advisory does not provide a separate source-code analysis for each listed version.
Think this verdict is wrong? Dispute it on GitHub or read how reports are produced.