MAL-2026-6544

See a problem?
Import Source
https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-as-persisted/MAL-2026-6544.json
JSON Data
https://api.osv.dev/v1/vulns/MAL-2026-6544
Aliases
  • GHSA-4wm6-vmww-2544
Published
2026-06-27T02:32:25Z
Modified
2026-06-30T16:16:46.098666638Z
Summary
Malicious code in chai-as-persisted (npm)
Details

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

Source: amazon-inspector (5cf9c49450e0fa0d47be1b6ae27991f844868ff6c435d2082948b5feae862709)

The package's postinstall script (npm run smoke:pino) executes index.js, which spawns a detached node lib/initializeCaller.js child. That module hides the C2 URL in base64 strings stored under a fabricated local process.env object (keys DEV_API_KEY, DEV_SECRET_KEY, DEV_SECRET_VALUE) to defeat trivial string scanning. At install time it atob()-decodes the URL to https://www.ipregionchecker.org/api/ip-check-encrypted/3aeb34a37, POSTs to it via axios, and passes the response body to new Function.constructor('require', response), invoking it with require — executing attacker-controlled JavaScript with full Node module access on the installer's machine. The detached child.unref() keeps execution alive after npm install returns. The package name chai-as-persisted is a one-edit impersonation of the widely-used chai-as-promised; the shipped code is unrelated to chai (it pretends to be a pino-style logger middleware in index.js) and the package description/keywords (logger/stream/json) further misrepresent its purpose. This is a deliberate install-time RCE dropper distributed via a typosquat against chai-as-promised.

Source: ghsa-malware (0ace79847a477da41888731730b793f631973178603034abe9016e81caffd10a)

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": [
        {
            "ranges": [
                {
                    "events": [
                        {
                            "introduced": "0"
                        }
                    ],
                    "type": "SEMVER"
                }
            ],
            "import_time": "2026-06-27T03:13:09.022299524Z",
            "id": "IN-MAL-2026-007675",
            "sha256": "5cf9c49450e0fa0d47be1b6ae27991f844868ff6c435d2082948b5feae862709",
            "versions": [
                "4.2.8"
            ],
            "source": "amazon-inspector",
            "modified_time": "2026-06-27T02:32:37Z"
        },
        {
            "ranges": [
                {
                    "events": [
                        {
                            "introduced": "0"
                        }
                    ],
                    "type": "SEMVER"
                }
            ],
            "import_time": "2026-06-27T03:13:08.872578262Z",
            "id": "IN-MAL-2026-007674",
            "sha256": "611d869aaf9d1a8b945c83cc9982fd76cd49a26563d444af3cee98ccb5b6fbda",
            "modified_time": "2026-06-27T02:32:25Z",
            "source": "amazon-inspector",
            "versions": [
                "6.1.9"
            ]
        },
        {
            "ranges": [
                {
                    "events": [
                        {
                            "introduced": "0"
                        }
                    ],
                    "type": "SEMVER"
                }
            ],
            "import_time": "2026-06-30T16:08:01.44831937Z",
            "id": "GHSA-4wm6-vmww-2544",
            "sha256": "0ace79847a477da41888731730b793f631973178603034abe9016e81caffd10a",
            "modified_time": "2026-06-30T15:59:31Z",
            "source": "ghsa-malware"
        }
    ]
}
References
Credits

Affected packages

npm / chai-as-persisted

Package

Affected ranges

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

Affected versions

4.*
4.2.8
6.*
6.1.9

Database specific

cwes
[
    {
        "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",
        "cweId": "CWE-506"
    },
    {
        "description": "The product contains code that appears to be malicious in nature.",
        "name": "Embedded Malicious Code",
        "cweId": "CWE-506"
    }
]
indicators
{
    "evidence_files": [
        {
            "path": "lib/initializeCaller.js",
            "tlsh": "4d119c4d71f82008042151e5b62f14126025e4673d8ad5e4bacc834b1fa667fbd53adf",
            "sha256": "76ca537732f161ae4d3a78b876390ddbab16e001c392a74009b31fb91ce4f89b"
        },
        {
            "path": "package.json",
            "tlsh": "d0019720debc4e2305ed25860c2a06037a615c175528fc2833e7922c0f9d5bb00ff22e",
            "sha256": "f061b9cb90a2c542ba90a73748290ff65dc070f811f75772bbfd0cc4453e0cbb"
        }
    ],
    "package_integrity": [
        {
            "filename": "chai-as-persisted-4.2.8.tgz",
            "hashes": {
                "sha1": "f81cd3b1b4fa7eb57ab85af8d81f00ae94b10c89",
                "sha512_sri": "sha512-OF+BlgV0u9rUuZYMvemtJ0jtoutqeNa8QgGbcduKIJEtdzrvqyHPkXKiBLwOBjOV6NQZL/j/0XmtVd9hDuBy+Q=="
            }
        }
    ]
}
source
"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-as-persisted/MAL-2026-6544.json"