MAL-2026-6218

See a problem?
Import Source
https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-as-attested/MAL-2026-6218.json
JSON Data
https://api.osv.dev/v1/vulns/MAL-2026-6218
Aliases
  • GHSA-v8fp-q6g9-vj9c
Published
2026-06-19T15:00:12Z
Modified
2026-06-23T13:32:39Z
Summary
Malicious code in chai-as-attested (npm)
Details

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

Source: amazon-inspector (88e27467366a90f482eb47476458b1f74d5a41ac63371572e527f2e60e4e0b51)

Package impersonates a pino-style logger (exports module.exports.pino, ships pino-like DEFAULT_LEVELS, keywords fast/logger/stream/json) but the exported middleware spawns a detached node lib/initializeCaller.js that fetches a JSON document from a hardcoded free file-hosting URL (https://amethyst-lorrin-26.tiiny.site/index.json) and executes the cookie field of the response via new Function.constructor('require', response)(require), granting the remote payload full Node require access. The endpoint URL and request headers are base64-encoded inside fake process.env-named constants and decoded at runtime with atob to evade scanners; the fetch is retried 5 times. Any consumer who imports the package and invokes the middleware (or runs the package's smoke script) executes attacker-controlled code on the host. The package name and pino-mimicking API surface are a lure — chai-as-attested has no relation to chai-as-promised or to pino.

Source: ghsa-malware (bb6756ece7eb10964628eea76db45ccc30a5d6b3fc01cccaafa48bce6c65d6ac)

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-007072",
            "import_time": "2026-06-19T15:41:55.286171535Z",
            "modified_time": "2026-06-19T15:00:12Z",
            "sha256": "88e27467366a90f482eb47476458b1f74d5a41ac63371572e527f2e60e4e0b51",
            "source": "amazon-inspector",
            "versions": [
                "6.0.3"
            ]
        },
        {
            "id": "GHSA-v8fp-q6g9-vj9c",
            "import_time": "2026-06-23T13:16:55.915230305Z",
            "modified_time": "2026-06-23T11:26:41Z",
            "ranges": [
                {
                    "events": [
                        {
                            "introduced": "0"
                        }
                    ],
                    "type": "SEMVER"
                }
            ],
            "sha256": "bb6756ece7eb10964628eea76db45ccc30a5d6b3fc01cccaafa48bce6c65d6ac",
            "source": "ghsa-malware"
        }
    ]
}
References
Credits

Affected packages

npm / chai-as-attested

Package

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

Affected ranges

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

Affected versions

6.*
6.0.3

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": "2a41c6b7c5e256d70f884c613c6412ef73d86f8cd8a65afe6afb64fabaf4e022",
            "tlsh": "f111008d61fc200c056512e6b22f18116022e4273d4ad4e47adc83470f9627fbd536df"
        },
        {
            "path": "package.json",
            "sha256": "d31a4dfa7836b9e53773cd31bf1a91be67cac8e3b50a5a7ea2d7b871cfe882e7",
            "tlsh": "22019c60ce788e2300ed25824c2a0643b6619c135928fc1932db512c0f9d5bf11ff21e"
        }
    ],
    "package_integrity": [
        {
            "filename": "chai-as-attested-6.0.3.tgz",
            "hashes": {
                "sha1": "6062fcd92a50e5e01ea2155aee1f972f75964547",
                "sha512_sri": "sha512-TOpABde1f4vP3sWDQtQggQiLDExJspmu2YxIg/Vm9zAZViy4+EzSO9pM0tVLyvTn4rIs9+GWQskmnO/CjvdMdg=="
            }
        }
    ]
}
source
"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-as-attested/MAL-2026-6218.json"