MAL-2026-7008

See a problem?
Import Source
https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-as-const/MAL-2026-7008.json
JSON Data
https://api.osv.dev/v1/vulns/MAL-2026-7008
Aliases
  • GHSA-c2cc-6c6f-8qrp
Published
2026-07-08T17:30:45Z
Modified
2026-08-04T22:05:00.602823724Z
Summary
Malicious code in chai-as-const (npm)
Details

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

Source: amazon-inspector (f2c70991a87f00f1b25b85243d1984fcb2562dc2c34f0c5514827b3660350294)

chai-as-const@1.4.5 is a disguised dropper. The package name is unrelated to its code, which impersonates the pino logger (exports pino middleware, ships lookalike files such as proto.js, redaction.js, transport.js, multistream.js). On first invocation of the exported middleware, index.js spawns a detached background task in lib/initializeCaller.js that (1) base64-decodes a hardcoded endpoint (https://ipcheck-hashed.vercel.app/api/auth/...), (2) POSTs the full process.env of the host to that endpoint, and (3) passes the HTTP response body to new Function("require", response.data) and executes it with require injected, yielding arbitrary remote code execution in the consumer's Node process. This combines credential/secret theft (all environment variables including CI tokens, cloud keys, and application secrets) with an attacker-controlled RCE channel, hidden behind base64 obfuscation of the C2 URL and a name that misrepresents the package's purpose.

Source: ghsa-malware (c52396968db7c2e5507abd6fbbe4c995de18144c9acf82bb50210c171709598f)

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": [
        {
            "sha256": "f2c70991a87f00f1b25b85243d1984fcb2562dc2c34f0c5514827b3660350294",
            "source": "amazon-inspector",
            "versions": [
                "1.4.5"
            ],
            "modified_time": "2026-07-08T17:30:45Z",
            "id": "IN-MAL-2026-008170",
            "import_time": "2026-07-08T17:40:19.766114169Z"
        },
        {
            "modified_time": "2026-07-16T21:23:52Z",
            "sha256": "c52396968db7c2e5507abd6fbbe4c995de18144c9acf82bb50210c171709598f",
            "ranges": [
                {
                    "events": [
                        {
                            "introduced": "0"
                        }
                    ],
                    "type": "SEMVER"
                }
            ],
            "source": "ghsa-malware",
            "id": "GHSA-c2cc-6c6f-8qrp",
            "import_time": "2026-07-16T21:36:36.575627476Z"
        },
        {
            "import_time": "2026-08-04T21:33:14.265556088Z",
            "modified_time": "2026-08-04T21:21:45Z",
            "versions": [
                "1.4.6"
            ],
            "source": "amazon-inspector",
            "id": "IN-MAL-2026-011027",
            "sha256": "1a37d7cf6d898c6f7df89f2481cb872626ed08a96813d60386a6c152d74ae337"
        },
        {
            "modified_time": "2026-08-04T21:21:38Z",
            "sha256": "6f5939c5287e547397991c9e022a3bff5823f0d3e6a25e01fa2fa1e6eed915cb",
            "versions": [
                "1.4.7"
            ],
            "source": "amazon-inspector",
            "id": "IN-MAL-2026-011026",
            "import_time": "2026-08-04T21:33:14.216369358Z"
        }
    ]
}
References
Credits

Affected packages

npm / chai-as-const

Package

Affected ranges

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

Affected versions

1.*
1.4.5
1.4.6
1.4.7

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"
    },
    {
        "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"
    }
]
source
"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-as-const/MAL-2026-7008.json"
indicators
{
    "evidence_files": [
        {
            "path": "lib/initializeCaller.js",
            "sha256": "266ef59f0542299b456e1d925e6c2c7f8db3b184ea9ca71e36bc037001a6d4f6",
            "tlsh": "51f0874d34b61036426e58e1bb1b54565403f56137c0d855f2cd536b0f4ed4df6636d4"
        },
        {
            "path": "index.js",
            "sha256": "1f51184c197102444a2c8a23e4a8e54a6479750420512922fcb5d5f795c33911",
            "tlsh": "0f318545b5f21259126d98c4f6b4a5263cdf9437331b76b1cded93952bce2080032bc7"
        }
    ],
    "package_integrity": [
        {
            "hashes": {
                "sha1": "68eb7bc8361e2c6f070d012cb7318f85551b47ed",
                "sha512_sri": "sha512-z4rAyWeHd9hq5pwdfVlrwSQgdbumLMbIi2ykrntPIVW8nNUjjz/Cho2Cw1kOoyfgV7XvJ42QqrvW7MSl/Oo2ng=="
            },
            "filename": "chai-as-const-1.4.5.tgz"
        }
    ]
}