MAL-2026-11032

See a problem?
Import Source
https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-as-stringify/MAL-2026-11032.json
JSON Data
https://api.osv.dev/v1/vulns/MAL-2026-11032
Aliases
  • GHSA-vh7h-h87g-qv6x
Published
2026-07-23T19:00:50Z
Modified
2026-08-04T23:04:53Z
Summary
Malicious code in chai-as-stringify (npm)
Details

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

Source: amazon-inspector (77eb9f214b2dc10f13ecfd3239542bc27fb35bdd5d0a645b41b398d8a4a3965d)

chai-as-stringify@7.0.1 is a typosquat of chai-as-promised. The tarball ships lib/config/config.env, a ~4MB heavily obfuscated JavaScript payload using obfuscator.io-style transforms (string-array shuffler, hex _0x... identifiers, char-code lookup, control-flow flattening). The .env extension conceals the JS blob from scanners that only inspect .js files. The package's top-level index.js executes require('./lib/config/config'), which resolves to this staged blob and runs it whenever the module is loaded. The package's advertised purpose is unrelated cover: the README is plagiarized verbatim from pino (Transports, Low overhead, nearForm/Platformatic acknowledgments) while claiming to provide 'Chai assertions for testing Reddit API responses'; author metadata is a generic james@abscond.org with homepage https://github.com/james; CI badges point at the placeholder github.com/yourusername/chai-as-stringify; the visible exported API is a no-op middleware stub. The combination of a typosquat name, plagiarized/placeholder metadata, and a large obfuscated payload staged under a non-JS extension and auto-loaded on require is the smuggle-and-cover-story supply-chain attack shape.

Source: ghsa-malware (06bb8071b2894038268bb513310437eed2c6ffc3aa534c8fae8b8273d7f56a9d)

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": "GHSA-vh7h-h87g-qv6x",
            "import_time": "2026-07-23T22:48:43.769510481Z",
            "modified_time": "2026-07-23T19:00:50Z",
            "ranges": [
                {
                    "events": [
                        {
                            "introduced": "0"
                        }
                    ],
                    "type": "SEMVER"
                }
            ],
            "sha256": "06bb8071b2894038268bb513310437eed2c6ffc3aa534c8fae8b8273d7f56a9d",
            "source": "ghsa-malware"
        },
        {
            "id": "IN-MAL-2026-011205",
            "import_time": "2026-08-04T22:30:04.978755523Z",
            "modified_time": "2026-08-04T21:47:29Z",
            "sha256": "1fd6c5d195eb4ada8b488b79a07e672fa6b2c093e0d50218ff824e90355aa718",
            "source": "amazon-inspector",
            "versions": [
                "7.0.2"
            ]
        },
        {
            "id": "IN-MAL-2026-011203",
            "import_time": "2026-08-04T22:30:04.891908176Z",
            "modified_time": "2026-08-04T21:47:15Z",
            "sha256": "77eb9f214b2dc10f13ecfd3239542bc27fb35bdd5d0a645b41b398d8a4a3965d",
            "source": "amazon-inspector",
            "versions": [
                "7.0.1"
            ]
        }
    ]
}
References
Credits

Affected packages

npm / chai-as-stringify

Package

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

Affected ranges

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

Affected versions

7.*
7.0.1
7.0.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"
    },
    {
        "cweId": "CWE-506",
        "description": "The product contains code that appears to be malicious in nature.",
        "name": "Embedded Malicious Code"
    }
]
indicators
{
    "evidence_files": [
        {
            "path": "lib/config.js",
            "sha256": "1176d4dea79d83166810bfe267ee4e31daa9c1b6d31c351c126bca6b1afb6a61",
            "tlsh": "d91685889245c523d2cc13a3be557aa9f13aa96584ccb607edf9bd6cb4bc807c0b5dd0"
        },
        {
            "path": "package.json",
            "sha256": "d0c2cf0890f9d503f18d6de6ea0ba2a24e473699b19f474b55f41c8223b92f8a",
            "tlsh": "dc017b30deb89e6304ed2a52482a0643b6654c579528fd2932db612c4fad5bb05ff21d"
        }
    ]
}
source
"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-as-stringify/MAL-2026-11032.json"