Advisory

MAL-2026-6995

Also known as: GHSA-89c7-5mf7-c86r

Malicious package Its source marks this package as malicious: it is not a vulnerability in a legitimate one.

Summary

Malicious code in chai-redirection (npm)

Details

---
_-= Per source details. Do not edit below this line.=-_

Source: amazon-inspector (38236fbbdbbaa8f8ed9315c3a4ff01fbf049215896036b1cb68611681fe0eb00)
chai-redirection presents itself as a chai assertion plugin but its main entry (index.js) unconditionally spawns a detached Node child process running lib/caller.js the moment the package is required. caller.js issues an HTTPS GET to https://www.jsonkeeper.com/b/PC5CK (a mutable pastebin-style host) and passes the response body's cookie field to new Function('require', res.data.cookie)(require), executing attacker-controlled JavaScript in the installer's Node process with full require access. A secondary code path builds a URL from lib/config values, and on a 404 response whose body carries a token field, constructs new Function.constructor('require', res.token) and invokes it with require — a second remote-code-execution channel. The advertised chai plugin API (validJWT, safeString, etc.) is a cover story: the loader runs before any exports are used, so merely requiring this package as a chai plugin triggers remote code execution. The mutable pastebin source means today's payload can be replaced with anything at any time without republishing the package.

Source: ghsa-malware (996d340e8231861ae21a30061eda3164b993e15bd08346375d8f886824b4fb6f)
Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.

Severity

Not rated by the source.

Dates

Published
2026-07-08 16:35 UTC
Modified
2026-07-10 03:31 UTC

Affected packages and fixes

chai-redirection

npm · All systems

Affected

  • introduced 0 (semver)

Fixed versions

None listed

Fix

No fixed version is listed.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: OpenSSF Malicious Packages · Apache-2.0

Sources & licences