MAL-2026-4513

See a problem?
Import Source
https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-as-tuned/MAL-2026-4513.json
JSON Data
https://api.osv.dev/v1/vulns/MAL-2026-4513
Aliases
  • GHSA-2f37-mh3q-7394
Published
2026-05-21T18:09:55Z
Modified
2026-05-29T23:01:55Z
Summary
Malicious code in chai-as-tuned (npm)
Details

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

Source: amazon-inspector (f7e00f81e117716cfd7fd3565cf8b04073cd494a6da2c23749669133806a7473)

Package name chai-as-tuned impersonates chai-as-promised and ships a README copy-pasted from the unrelated pino project (npm/CI badges point at pinojs/pino). The advertised middleware in index.js spawns lib/initializeCaller.js as a detached node process whenever the exported function is invoked. That script constructs a fake local process object whose DEV_API_KEY is a base64 literal decoding to https://aqua-margit-84.tiiny.site/index.json (tiiny.site is an anonymous static-hosting service), GETs the JSON via axios, and passes the response.cookie field to new Function.constructor('require', response)(require) — executing attacker-controlled JavaScript with full Node privileges and access to the host's require. The combination of name-confusion, copied README, base64-hidden C2 URL, Function.constructor indirection to defeat static review, and remote-fetch-and-eval is an unambiguous supply-chain attack: any consumer who follows the README and uses the main export will execute whatever code the attacker serves at runtime.

Source: ghsa-malware (456afd075e2df98b9a07a876eb8b1e26cff0afe3f517d7b0f226f654e3e22bed)

Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.

Database specific
{
    "malicious-packages-origins": [
        {
            "id": "IN-MAL-2026-003965",
            "import_time": "2026-05-26T05:51:40.378097795Z",
            "modified_time": "2026-05-21T18:09:55Z",
            "sha256": "f7e00f81e117716cfd7fd3565cf8b04073cd494a6da2c23749669133806a7473",
            "source": "amazon-inspector",
            "versions": [
                "7.2.2"
            ]
        },
        {
            "id": "GHSA-2f37-mh3q-7394",
            "import_time": "2026-05-29T22:44:05.948831068Z",
            "modified_time": "2026-05-29T22:09:20Z",
            "ranges": [
                {
                    "events": [
                        {
                            "introduced": "0"
                        }
                    ],
                    "type": "SEMVER"
                }
            ],
            "sha256": "456afd075e2df98b9a07a876eb8b1e26cff0afe3f517d7b0f226f654e3e22bed",
            "source": "ghsa-malware"
        }
    ]
}
References
Credits

Affected packages

npm / chai-as-tuned

Package

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

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected

Affected versions

7.*
7.2.2

Database specific

cwes
[
    {
        "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"
    }
]
indicators
{
    "evidence_files": [
        {
            "path": "lib/initializeCaller.js",
            "sha256": "c228e2f20e0dec3cf4e151033fdb13715c2f43975ee5ccf58caf059e104a5266",
            "tlsh": "6911cc8d61fd201c056652e6b62f18126022e4673d86d4e47acc83471fe526fbd536df"
        },
        {
            "path": "package.json",
            "sha256": "8e0be12f9b53dca3836302ddd139ae33384a8690c6bfbacd350e2f0243b519bd",
            "tlsh": "75019c20ce789e2304ed25824c2a064376618c539928fc1932db512c0f9d5ff05bf21e"
        }
    ],
    "package_integrity": [
        {
            "filename": "chai-as-tuned-7.2.2.tgz",
            "hashes": {
                "sha1": "4ce120c4c0ce3e76dc1b86e55adef11dda127499",
                "sha512_sri": "sha512-YcB6WVzcYRq6IEaW1ltqGTSHY8lcuVD4DRNmViwxBQjOvgXJy/idV2N760oeqaw9hbhu5/pDkfa+ManvSxNsXQ=="
            }
        }
    ]
}
source
"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-as-tuned/MAL-2026-4513.json"