MAL-2026-13356

See a problem?
Import Source
https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-foundry/MAL-2026-13356.json
JSON Data
https://api.osv.dev/v1/vulns/MAL-2026-13356
Aliases
  • GHSA-x29h-74hf-jq7x
Published
2026-08-05T16:37:52Z
Modified
2026-09-01T11:31:30.453854490Z
Summary
Malicious code in chai-foundry (npm)
Details

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

Source: amazon-inspector (94e40493af5310c6ee769911bff65e55538911ae3f286fba2a3474f9f8a38940)

chai-foundry@7.0.2 is a trojan package presenting itself as a chai plugin (README shows chai.use(chaiLeaf)) while its badges, documentation, and internal version metadata (lib/meta.js exports version 9.6.0) are copied from the pino logger. The package's main entry index.js immediately loads ./lib/config, a 3.5MB file that is heavily obfuscated with obfuscator.io-class transforms: a rotated string array of 20,855 entries, two runtime decoder functions, tens of thousands of decoder-wrapper indirections, and control-flow flattening (104,934 deobfuscation changes reported by webcrack). The file begins with a top-level IIFE, so its opaque body runs automatically the moment any consumer calls require('chai-foundry'). All destinations and string constants are reconstructed at runtime, so the payload's network endpoints and behaviors are hidden from static inspection. The combination of identity impersonation, mismatched metadata, and a multi-megabyte control-flow-flattened import-time loader in a package advertised as a small chai plugin is the canonical shape of a hostile npm dropper/stealer.

Source: ghsa-malware (7493f27a9dde87cd284125de3d582e1cd94870a2c4bac65ae9c6f1d764dfbee0)

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": [
        {
            "import_time": "2026-08-05T17:04:49.368060143Z",
            "source": "amazon-inspector",
            "versions": [
                "7.0.3"
            ],
            "id": "IN-MAL-2026-015827",
            "modified_time": "2026-08-05T16:37:52Z",
            "sha256": "47d799affc9421116994671c24da24cabadfb12a42d5b12ac54b2fce2aa1afe2"
        },
        {
            "import_time": "2026-08-05T17:04:49.46756877Z",
            "id": "IN-MAL-2026-015828",
            "versions": [
                "7.0.2"
            ],
            "source": "amazon-inspector",
            "modified_time": "2026-08-05T16:38:06Z",
            "sha256": "94e40493af5310c6ee769911bff65e55538911ae3f286fba2a3474f9f8a38940"
        },
        {
            "import_time": "2026-08-18T12:29:51.356706018Z",
            "id": "GHSA-x29h-74hf-jq7x",
            "source": "ghsa-malware",
            "ranges": [
                {
                    "type": "SEMVER",
                    "events": [
                        {
                            "introduced": "0"
                        }
                    ]
                }
            ],
            "modified_time": "2026-08-18T11:34:04Z",
            "sha256": "7493f27a9dde87cd284125de3d582e1cd94870a2c4bac65ae9c6f1d764dfbee0"
        },
        {
            "import_time": "2026-09-01T11:17:28.695792517Z",
            "id": "RLMA-2026-06139",
            "versions": [
                "7.0.2"
            ],
            "source": "reversing-labs",
            "modified_time": "2026-08-24T16:43:57Z",
            "sha256": "6354db7f8548a052c4fe64217049400ca070d6933c8b5e83e40e240171971e07"
        }
    ]
}
References
Credits

Affected packages

npm / chai-foundry

Package

Affected ranges

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

Affected versions

7.*
7.0.2
7.0.3

Database specific

source
"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-foundry/MAL-2026-13356.json"
indicators
{
    "evidence_files": [
        {
            "path": "index.js",
            "tlsh": "0421149124d560ce9938dac0f6306115acdbc677260752b3bdfc97c927860080161fba",
            "sha256": "4e6c4e61a7019ab0affe9c2d20e36701b330ec357be205930355bac1464f9316"
        },
        {
            "path": "lib/config.js",
            "tlsh": "261652d88984d123d3de9b13fe14a9a8f1fa79a6d4cce40b86987d4d29fc847d4a0cd4",
            "sha256": "8397643af68793d57aec3637e79324e9183d6f1168009cd0676432515e88c515"
        },
        {
            "path": "package.json",
            "tlsh": "c0019e24de789e2304fd25524c2a06037a614c175528fc2932db612c4f5d5ff41ff21d",
            "sha256": "8f82750cc52cd72a3f3f941a3474b192a18cac0c56acdfbe35bfd6d8cf602d10"
        }
    ],
    "package_integrity": [
        {
            "filename": "chai-foundry-7.0.3.tgz",
            "hashes": {
                "sha512_sri": "sha512-98Lhn+hs8c34dV82aVYJYuuJJ6PcoUQpi3lJr9Zp156eSXA5YEHpt6lt+tRzhQemoxCbNvn49bWPVixqpXATmA==",
                "sha1": "16fad30993d42f54098d3873a08527f0e3057aaa"
            }
        }
    ]
}
cwes
[
    {
        "description": "The product contains code that appears to be malicious in nature.",
        "cweId": "CWE-506",
        "name": "Embedded Malicious Code"
    },
    {
        "description": "The product contains code that appears to be malicious in nature.",
        "cweId": "CWE-506",
        "name": "Embedded Malicious Code"
    },
    {
        "description": "The product contains code that appears to be malicious in nature.",
        "cweId": "CWE-506",
        "name": "Embedded Malicious Code"
    }
]