Malicious code in chai-as-indexed (npm)
--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (6bd158a05893a55a82bee4867772aefbfb3199a443c38e7161db1a71d47ced86) chai-as-indexed presents itself as a pino-compatible logger (package.json keywords fast/logger/stream/json, exports module.exports.pino, lib/* filenames mirror pino) but the exported middleware's only real action is to spawn a detached Node child that runs lib/caller.js. lib/caller.js hides its C2 behind a fake local `process.env` object whose values are base64 literals (DEV_API_KEY, DEV_SECRET_KEY, DEV_SECRET_VALUE); at runtime they decode to the URL https://tomato-erminie-2.tiiny.site/index.json and a request header. The decoded URL is fetched and the JSON response's `cookie` field is passed to `new Function.constructor('require', response)(require)`, executing attacker-controlled JavaScript with the host process's full Node privileges and `require` handed in. The destination is an anonymous, author-mutable tiiny.site host with no pinning or integrity check. Any application that requires this package expecting pino and invokes the middleware will fetch and execute whatever the attacker is currently serving.
- Products
- chai-as-indexed
- Affected versions
- 6.0.5, 7.2.8
- Fixed versions
- Not specified
- CVEs
- Not specified
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 28 Oct 2026, 08:58 UTC · Revision 1
Source evidence
--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (6bd158a05893a55a82bee4867772aefbfb3199a443c38e7161db1a71d47ced86) chai-as-indexed presents itself as a pino-compatible logger (package.json keywords fast/logger/stream/json, exports module.exports.pino, lib/* filenames mirror pino) but the exported middleware's only real action is to spawn a detached Node child that runs lib/caller.js. lib/caller.js hides its C2 behind a fake local `process.env` object whose values are base64 literals (DEV_API_KEY, DEV_SECRET_KEY, DEV_SECRET_VALUE); at runtime they decode to the URL https://tomato-erminie-2.tiiny.site/index.json and a request header. The decoded URL is fetched and the JSON response's `cookie` field is passed to `new Function.constructor('require', response)(require)`, executing attacker-controlled JavaScript with the host process's full Node privileges and `require` handed in. The destination is an anonymous, author-mutable tiiny.site host with no pinning or integrity check. Any application that requires this package expecting pino and invokes the middleware will fetch and execute whatever the attacker is currently serving.
osv:MAL-2026-16293
chai-as-indexed
Fixed versions: Not specified
Complete source record
{
"id": "24378dc8e8f1a51bd506c27144d1d7310877838c5290dfeb690f7f9f62734740",
"url": "https://osv.dev/vulnerability/MAL-2026-16293",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Malicious code in chai-as-indexed (npm)",
"summary": "--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (6bd158a05893a55a82bee4867772aefbfb3199a443c38e7161db1a71d47ced86) chai-as-indexed presents itself as a pino-compatible logger (package.json keywords fast/logger/stream/json, exports module.exports.pino, lib/* filenames mirror pino) but the exported middleware's only real action is to spawn a detached Node child that runs lib/caller.js. lib/caller.js hides its C2 behind a fake local `process.env` object whose values are base64 literals (DEV_API_KEY, DEV_SECRET_KEY, DEV_SECRET_VALUE); at runtime they decode to the URL https://tomato-erminie-2.tiiny.site/index.json and a request header. The decoded URL is fetched and the JSON response's `cookie` field is passed to `new Function.constructor('require', response)(require)`, executing attacker-controlled JavaScript with the host process's full Node privileges and `require` handed in. The destination is an anonymous, author-mutable tiiny.site host with no pinning or integrity check. Any application that requires this package expecting pino and invokes the middleware will fetch and execute whatever the attacker is currently serving.",
"evidence": "osv:MAL-2026-16293",
"products": [
{
"name": {
"value": "chai-as-indexed",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "7.2.8",
"evidence": "/affected/0/versions"
},
{
"value": "6.0.5",
"evidence": "/affected/0/versions"
}
]
}
],
"severity": "unknown",
"structured": {
"id": "MAL-2026-16293",
"aliases": [
"MAL-2026-16293"
],
"affected": [
{
"package": {
"name": "chai-as-indexed",
"purl": "pkg:npm/chai-as-indexed",
"ecosystem": "npm"
},
"versions": [
"7.2.8",
"6.0.5"
],
"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."
}
],
"source": "https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-as-indexed/MAL-2026-16293.json",
"indicators": {
"evidence_files": [
{
"path": "lib/initializeCaller.js",
"tlsh": "6af0819d34ba223a42ad64f2b61714551113f42137d5d456f3cd42650f4dd4c6771bc8",
"sha256": "e384bffa5e90fb424deb80e2d4f1edf3984f7372cd38943eb63812055b807d93"
}
],
"package_integrity": [
{
"hashes": {
"sha1": "3057a544492379e40ad2761e503492c2623e148a",
"sha512_sri": "sha512-GJYoViTyWpM0lQTPUBwq5kTrBb4fwVUammsiZdLX/V69R4TsuG8UoXNgQNDp5PIhWrSHZgWgUZq1ngGvRi1lAg=="
},
"filename": "chai-as-indexed-7.2.8.tgz"
}
]
}
}
}
],
"modified": "2026-10-08T04:00:04.183790357Z",
"provider": "osv",
"references": [
"https://www.npmjs.com/package/chai-as-indexed/v/7.2.8",
"https://www.npmjs.com/package/chai-as-indexed/v/6.0.5"
],
"provider_metadata": {
"malicious-packages-origins": [
{
"id": "IN-MAL-2026-020191",
"sha256": "424ebdaa04d4f7e8ce306f536421ac65d79467e73b05877caac6b72071bdaef9",
"source": "amazon-inspector",
"versions": [
"7.2.8"
],
"import_time": "2026-09-18T20:38:14.059880859Z",
"modified_time": "2026-09-18T20:25:47Z"
},
{
"id": "IN-MAL-2026-021118",
"sha256": "6bd158a05893a55a82bee4867772aefbfb3199a443c38e7161db1a71d47ced86",
"source": "amazon-inspector",
"versions": [
"6.0.5"
],
"import_time": "2026-10-08T03:50:29.086797557Z",
"modified_time": "2026-10-08T03:38:40Z"
}
]
}
},
"related_cves": [],
"security_relevant": true,
"severity_evidence": null
},
"source_id": "core-osv",
"document_id": 98423,
"published_at": "2026-09-18T20:25:47+00:00"
}