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-09-01T11:31:00Z
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",
            "modified_time":  "2026-08-05T13:33:19Z",
            "sha256":  "bc4795830ed2849aaf2a6eaa488fbecc42a31c2d6d212fe34e635c16217e46ed",
            "source":  "amazon-inspector",
            "versions":  [
                "2.2.4"
            ]
        },
        {
            "id":  "RLMA-2026-06117",
            "import_time":  "2026-09-01T11:17:27.745635943Z",
            "modified_time":  "2026-08-24T16:43:26Z",
            "sha256":  "704d1638e1c13d80e480c6d20b2ff29e94b67e9a1305a87b749e721db0dab74a",
            "source":  "reversing-labs",
            "versions":  [
                "2.2.4"
            ]
        }
    ]
}
References
Credits

Affected packages

npm / chai-as-inspired

Package

Name
chai-as-inspired
View open source insights on deps.dev
Purl
pkg:npm/chai-as-inspired

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
{
    "evidence_files":  [
        {
            "path":  "lib/caller.js",
            "sha256":  "ffa61701ff61ebc0c6d64cf09f5bc37a74a91b03b716129b90271d758dc164b7",
            "tlsh":  "6e01efd934fd501c021111ea171fa032a010e4373882d6c8374cc7428fa66bd2e93aef"
        }
    ],
    "package_integrity":  [
        {
            "filename":  "chai-as-inspired-2.2.4.tgz",
            "hashes":  {
                "sha1":  "11ea6078ee1e5eb5a87a694f248ad856e9732f0f",
                "sha512_sri":  "sha512-YGDDLhVy5rc1IQpW74EZy85bza4B6XznnZUYeZr8V8g3zqy5+B8LVMcztczl4PTInJNIS/sJ/eYtVj0Y3Bw0KQ=="
            }
        }
    ]
}
source
"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-as-inspired/MAL-2026-12540.json"