MAL-2026-14200Malicious code in chai-as-gateway (npm)
| Ecosystem | Package | Version |
|---|---|---|
| npm | chai-as-gateway | 7.1.5 |
{"modified":"2026-08-19T01:59:46Z","published":"2026-08-19T01:59:46Z","schema_version":"1.7.4","id":"MAL-2026-14200","summary":"Malicious code in chai-as-gateway (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (f90afdde9240783f1f869b875b7967490cf579e1bae0986861498f8c98c0d973)\nThe package advertises itself as a logger (README and type definitions copied wholesale from pinojs/pino) but its exported middleware is a no-op that simply calls next(). index.js unconditionally executes require('./lib/config') at module top level, and lib/config.js is a ~4MB obfuscator.io-style blob (string-array rotate loader, ~24k entries, hex-escaped identifiers) whose only purpose is to run on import. The obfuscated blob contains references to child_process exec/spawn, axios (declared as a runtime dependency in package.json), fs directory traversal via withFileTypes, the path fragment.aws, and the full base64 alphabet — the standard shape of an installer-secret harvester that walks the home directory for AWS credentials and exfiltrates over HTTP. The package name resembles unrelated popular packages, the description string ('vulnerabilities management document') does not match the pino-cloned documentation, and author metadata is a generic hello@jsonspack.com address. Requiring this package auto-executes attacker-controlled code on the installer.\n","affected":[{"package":{"ecosystem":"npm","name":"chai-as-gateway"},"versions":["7.1.5"],"database_specific":{"cwes":[{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"}],"indicators":{"evidence_files":[{"path":"lib/config.js","sha256":"8397643af68793d57aec3637e79324e9183d6f1168009cd0676432515e88c515","tlsh":"261652d88984d123d3de9b13fe14a9a8f1fa79a6d4cce40b86987d4d29fc847d4a0cd4"},{"path":"package.json","sha256":"8a252b1e5ea35464e9dc2c2d67420bac2b432b911adf07a5d16b7cb0f911fa23","tlsh":"ca017b20de784e6304ed25525c2a064376614c175528fd1932db612c4f9d5ff01bf21d"}],"package_integrity":[{"filename":"chai-as-gateway-7.1.5.tgz","hashes":{"sha1":"28424b4019235b241f14f9760c8f48413437ce3d","sha512_sri":"sha512-x3Dh6gMstuo6X6s1SI9FkWeaCvbEC1k4+TSIpidmtbM9Sl8TwAOdZ+bAZ6JqjWlFIxNtzuN1L0cLy5CSIWgdOQ=="}}]}}}],"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/chai-as-gateway/v/7.1.5"}],"credits":[{"name":"Amazon Inspector","type":"FINDER","contact":["inspector-research@amazon.com"]}],"database_specific":{"malicious-packages-origins":[{"id":"IN-MAL-2026-018289","import_time":"2026-08-19T02:31:08.598969158Z","modified_time":"2026-08-19T01:59:46Z","sha256":"f90afdde9240783f1f869b875b7967490cf579e1bae0986861498f8c98c0d973","source":"amazon-inspector","versions":["7.1.5"]}]}}数据来源:OpenSSF Malicious Packages · Apache-2.0