MAL-2026-12540

See a problem?
Import Source
https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-as-inspired/MAL-2026-12540.json
JSON Data
https://api.osv.dev/v1/vulns/MAL-2026-12540
Published
2026-08-05T13:33:19Z
Modified
2026-08-05T14:35:08.548570666Z
Summary
Malicious code in chai-as-inspired (npm)
Details

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

Source: amazon-inspector (bc4795830ed2849aaf2a6eaa488fbecc42a31c2d6d212fe34e635c16217e46ed)

chai-as-inspired is a typosquat resembling chai/pino packages. Its middleware entrypoint (index.js) spawns a detached node lib/caller.js child on invocation. caller.js hides its network destination behind a fake process.env object whose values are base64 blobs; decoding yields the URL https://api.jsonstorage.net/v1/json/2ef8c758-a96f-459e-b036-b3b90379a165/f89e8264-86c2-4684-94da-c3f82d59370f and an x-secret-key header. The response's cookie field is passed to new Function.constructor('require', s)(require), executing attacker-controlled JavaScript in a retry loop with the installer's require and full Node privileges. The remote content is hosted on a mutable, anonymous JSON-storage bucket and can be changed at any time by the operator. The base64 disguise of the endpoint and header keys, combined with the fetch-and-eval mechanism, establishes hostile intent.

Database specific
{
    "malicious-packages-origins": [
        {
            "id": "IN-MAL-2026-014977",
            "import_time": "2026-08-05T14:19:48.641055279Z",
            "sha256": "bc4795830ed2849aaf2a6eaa488fbecc42a31c2d6d212fe34e635c16217e46ed",
            "modified_time": "2026-08-05T13:33:19Z",
            "versions": [
                "2.2.4"
            ],
            "source": "amazon-inspector"
        }
    ]
}
References
Credits

Affected packages

npm / chai-as-inspired

Package

Affected ranges

Affected versions

2.*
2.2.4

Database specific

cwes
[
    {
        "cweId": "CWE-506",
        "description": "The product contains code that appears to be malicious in nature.",
        "name": "Embedded Malicious Code"
    }
]
indicators
{
    "package_integrity": [
        {
            "hashes": {
                "sha512_sri": "sha512-YGDDLhVy5rc1IQpW74EZy85bza4B6XznnZUYeZr8V8g3zqy5+B8LVMcztczl4PTInJNIS/sJ/eYtVj0Y3Bw0KQ==",
                "sha1": "11ea6078ee1e5eb5a87a694f248ad856e9732f0f"
            },
            "filename": "chai-as-inspired-2.2.4.tgz"
        }
    ],
    "evidence_files": [
        {
            "sha256": "ffa61701ff61ebc0c6d64cf09f5bc37a74a91b03b716129b90271d758dc164b7",
            "path": "lib/caller.js",
            "tlsh": "6e01efd934fd501c021111ea171fa032a010e4373882d6c8374cc7428fa66bd2e93aef"
        }
    ]
}
source
"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-as-inspired/MAL-2026-12540.json"