MAL-2026-10053

See a problem?
Import Source
https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-secure/MAL-2026-10053.json
JSON Data
https://api.osv.dev/v1/vulns/MAL-2026-10053
Published
2026-07-09T15:31:39Z
Modified
2026-07-09T16:31:54.357342331Z
Summary
Malicious code in chai-secure (npm)
Details

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

Source: amazon-inspector (4253b6520b80bd3c3ee724b9766c67a3a2d7abe074ee57e15d5b9b270bf74f55)

chai-secure masquerades as a Chai plugin offering JWT/XSS/SQLi assertion helpers, but on every require()/import of the package, index.js unconditionally spawns a detached, stdio-ignored Node child process running lib/caller.js. lib/caller.js issues a GET to http://server-genimi-check.vercel.app/defy/v3 over plain HTTP and, when the server responds with HTTP 404 carrying a token field in the body, passes that field to new Function.constructor('require', res.token) and invokes it with the host require — executing attacker-supplied JavaScript with full package and host privileges on the installer's machine. Delivery via the 404 error path is an evasion technique that hides the payload channel from casual inspection, and plain HTTP additionally exposes the channel to on-path substitution. The assertion-helper API in index.js is a cover story; the README does not disclose the child_process spawn or the remote fetch. Several sibling files under lib/ (multistream.js, transport.js, worker.js, redaction.js) appear borrowed from pino to inflate the package's apparent surface area, and lib/caller.js contains a fake JSDoc-annotated getCallers() export that is never referenced. Any developer who installs chai-secure and imports it as the README instructs silently launches a background process that fetches and evaluates arbitrary attacker-controlled JavaScript.

Database specific
{
    "malicious-packages-origins": [
        {
            "sha256": "4253b6520b80bd3c3ee724b9766c67a3a2d7abe074ee57e15d5b9b270bf74f55",
            "id": "IN-MAL-2026-009123",
            "import_time": "2026-07-09T16:20:42.888538941Z",
            "versions": [
                "1.2.3"
            ],
            "modified_time": "2026-07-09T15:31:39Z",
            "source": "amazon-inspector"
        },
        {
            "sha256": "4eadf787e8ff67d17525d8d970f445701b69bd26bef41bec60605176f2be9d06",
            "id": "IN-MAL-2026-009124",
            "import_time": "2026-07-09T16:20:43.035176086Z",
            "modified_time": "2026-07-09T15:31:47Z",
            "versions": [
                "1.2.5"
            ],
            "source": "amazon-inspector"
        }
    ]
}
References
Credits

Affected packages

npm / chai-secure

Package

Affected ranges

Affected versions

1.*
1.2.3
1.2.5

Database specific

indicators
{
    "evidence_files": [
        {
            "sha256": "f71d4a3288b9d81d53c724c92e9731c133a592342ec3a301974ab5c0a85577aa",
            "tlsh": "85c1e2a839a3e0188563b1f5097fa416d476a017202dd9d8b5ecc2d01fddee89523dfb",
            "path": "index.js"
        },
        {
            "sha256": "e8a73ca951f7af5663bbbff07c9d57b43c1649109ddaf49a7364d2e5b300e8fa",
            "tlsh": "8721245628fa31190726a8deca4bd4313426f5332626d0c0f69c87861fe789e96b77dc",
            "path": "lib/caller.js"
        },
        {
            "tlsh": "440145a4cc789e7304da22a644294157a1619e078c48fc0e33ea412c8f9c9af50fea6e",
            "sha256": "167a43c61ca37d6b2369531c95839db120978fbf9ecd0eea3236dd3390fae234",
            "path": "package.json"
        }
    ],
    "package_integrity": [
        {
            "filename": "chai-secure-1.2.3.tgz",
            "hashes": {
                "sha512_sri": "sha512-MVO+xTxvwfyGoWhNMGw0npmN3t9GH/zULQpPrr/pIg0hGseqM6Tb7JLCn5EuQvHBkVvcj9iMi2xtCoL/7dzSuA==",
                "sha1": "f8a5c28eb4aa58ce1e1d8fa6c791e450fd8da7b9"
            }
        }
    ]
}
cwes
[
    {
        "name": "Embedded Malicious Code",
        "cweId": "CWE-506",
        "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."
    }
]
source
"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-secure/MAL-2026-10053.json"