Advisory

MAL-2026-6532

Also known as: GHSA-m282-3m8c-qjwj

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

Summary

Malicious code in chai-as-assured (npm)

Details

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

Source: amazon-inspector (bd28efd7a3d07f87ec22556cc25a8c07117fa4cdd237c6cb1db750c976a11836)
chai-as-assured impersonates the popular chai-as-promised package (matching README, author, and API surface). When the exported plugin function is invoked under normal usage, an async IIFE in the plugin body base64-decodes a hardcoded URL (https://amethyst-lorrin-26.tiiny.site/index.json), performs an axios.get against that anonymous third-party host with a disguised header, and executes the response's cookie field as JavaScript via new Function.constructor('require', response)(require). The fetched payload runs with full Node module privileges (filesystem, network, child_process, etc.) because require is passed in. The C2 URL, header name (x-secret-key), and header value are concealed as base64 strings inside a fake local process.env object (DEV_API_KEY / DEV_SECRET_KEY / DEV_SECRET_VALUE) that shadows Node's global to evade casual source review. The combination of name-confusion against a top-100 chai ecosystem package, deliberate obfuscation of attacker infrastructure, an unpinned anonymous tiiny.site host, and dynamic execution of the fetched response with require is an unambiguous remote-code-execution dropper targeting any project that installs and loads this plugin.

Source: ghsa-malware (c485746666d65194fcec1929637bee2ef3f7f7c1a427a5e28eaf2ce162ea8c19)
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-06-26 17:44 UTC
Modified
2026-07-10 17:01 UTC

Affected packages and fixes

chai-as-assured

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