chai-as-regulated
This report shows the evidence for chai-as-regulated@2.0.12, 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-3753 confirms this npm version as malicious.
Advisory
MAL-2026-3753
Source
OpenSSF Malicious Packages via OSV
Summary
Malicious code in chai-as-regulated (npm)
Details
Package is published as `chai-as-regulated`, a name mimicking the widely-used `chai-as-promised` Chai plugin, and the README instructs users to register it via `chai.use(chaiAsRegulated)`. The shipped code, however, does not implement a Chai plugin: the tarball contains Pino logger source files (lib/levels.js, lib/proto.js, lib/tools.js, lib/transport.js, docs referencing pinojs/pino), and the package.json description is unrelated boilerplate ("This document describes the management of vulnerabilities for the project and all modules within the organization."). The exported middleware in index.js (lines 32-50) calls `runBackgroundTask`, which uses `child_process.spawn('node', [scriptPath, JSON.stringify(args)], { detached: true, stdio: 'ignore' })` followed by `child.unref()` to silently launch `./lib/initializeCaller.js` as a detached background process passing caller-supplied arguments. The referenced `initializeCaller.js` is absent from this tarball, so no payload executes today, but the loader shape (typosquat name + identity lie + detached orphan-process spawner pointing at a sibling file) is structured for a future-version payload swap. The combination of name confusion against a popular target, copied unrelated source used as cover, and a silent background-launcher wired into the advertised API exceeds the bar for typosquat-with-payload-shape.
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-regulated@2.0.12.
The versions list below shows the verdict for each recorded version.
- Avoid installing chai-as-regulated@2.0.12. 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.