chai-secure @1.2.5
Vulnerability report · Last retrieved from osv.dev July 9, 2026 at 6:28 PM UTC
OSV ID
MAL-2026-10053
Ecosystem
npm
Summary
chai-secure masquerades as a Chai plugin offering JWT/XSS/SQLi assertion helpers, but on every require()/import of the package, index.js unconditionally spawns a detached, stdio-ignored Node child process running lib/caller.js. lib/caller.js issues a GET to http://server-genimi-check.vercel.app/defy/v3 over plain HTTP and, when the server responds with HTTP 404 carrying a token field in the body, passes that field to new Function.constructor('require', res.token) and invokes it with the host require — executing attacker-supplied JavaScript with full package and host privileges on the installer's machine. Delivery via the 404 error path is an evasion technique that hides the payload channel from casual inspection, and plain HTTP additionally exposes the channel to on-path substitution. The assertion-helper API in index.js is a cover story; the README does not disclose the child_process spawn or the remote fetch. Several sibling files under lib/ (multistream.js, transport.js, worker.js, redaction.js) appear borrowed from pino to inflate the package's apparent surface area, and lib/caller.js contains a fake JSDoc-annotated getCallers() export that is never referenced. Any developer who installs chai-secure and imports it as the README instructs silently launches a background process that fetches and evaluates arbitrary attacker-controlled JavaScript.
Source: amazon-inspector (4253b6520b80bd3c3ee724b9766c67a3a2d7abe074ee57e15d5b9b270bf74f55)
Protect your entire dependency tree
Scan your lock files automatically on every PR. Block malicious packages before they reach production.