Malicious code in chai-leaf (npm)
--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (77cc7562a27df348fafc455124fd845dfc2e5774c42279ee6e3dd8f1cfb1f05b) chai-leaf@1.4.5's main entry index.js unconditionally requires./lib/config, which is a single 3,546,568-byte obfuscator.io-encoded file (20,721-entry string array with self-defending routines) that runs immediately on require(). The decoded string table inside lib/config.js contains literals for.ssh and.aws (installer credential directories) alongside axios, spawn, exec, Function, and require — the shape of a load-time credential stealer that reads secrets from the installer's home directory and exfiltrates via HTTP. package.json declares axios as a runtime dependency. The package presents itself with inconsistent cover stories: package.json describes it as vulnerability-management documentation while the README impersonates pino (badges, prose, and docs/api.md copied verbatim from pinojs/pino) and the lib/ tree mirrors pino's file names (proto.js, redaction.js, tools.js, transport.js, worker.js) with the extra obfuscated config.js that has no analog in real pino. The package name and README also allude to chai, unrelated to either declared purpose. A logger/chai plugin has no legitimate need for a multi-megabyte self-defending obfuscated blob that executes at import, and no legitimate need to reference ~/.ssh and ~/.aws. ## Source: ghsa-malware (38312fd425c2921477fe6eecb5036500bcdbc1735dee43f3a84cfcbf2ba3002f) Any computer
MAL-2026-10940
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: osv:MAL-2026-10940
chai-leaf
Source reference: /affected/0/package/name
- Affected versions
- 1.4.5
Source reference:
/affected/0/versions1.4.7Source reference:
/affected/0/versions1.4.6Source reference:
/affected/0/versions1.4.8Source reference:
/affected/0/versions - Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "chai-leaf",
"purl": "pkg:npm/chai-leaf",
"ecosystem": "npm"
},
"versions": [
"1.4.5",
"1.4.7",
"1.4.6",
"1.4.8"
],
"database_specific": {
"cwes": [
{
"name": "Embedded Malicious Code",
"cweId": "CWE-506",
"description": "The product contains code that appears to be malicious in nature."
},
{
"name": "Embedded Malicious Code",
"cweId": "CWE-506",
"description": "The product contains code that appears to be malicious in nature."
},
{
"name": "Embedded Malicious Code",
"cweId": "CWE-506",
"description": "The product contains code that appears to be malicious in nature."
},
{
"name": "Embedded Malicious Code",
"cweId": "CWE-506",
"description": "The product contains code that appears to be malicious in nature."
},
{
"name": "Embedded Malicious Code",
"cweId": "CWE-506",
"description": "The product contains code that appears to be malicious in nature."
}
],
"source": "https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-leaf/MAL-2026-10940.json",
"indicators": {
"evidence_files": [
{
"path": "lib/config.js",
"tlsh": "70f5b8487971e03783dd1767be4a1fece63a186694c8a52b8558bd9f39bc107c1a3ce0",
"sha256": "1e3f9c43442ed0d25dcaa88833a12cf68ab3865c55031308fe4b5e8ec29c3a92"
},
{
"path": "package.json",
"tlsh": "30019e30de788e6304ed25524c2a064376614c175528fd1932db512c4f9d5ff41ff21d",
"sha256": "95dc27fda05b43b8c59a7004a84ecd04660e92a40d8edecd7aba066bf6c69e46"
}
]
}
}
}
]Publisher severity
No explicit severity was provided.
- Event
- #6137 · Revision 1
- Added to Heist Feed
- Publisher date