MAL-2026-10405

See a problem?
Import Source
https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/@torbeck/heap/MAL-2026-10405.json
JSON Data
https://api.osv.dev/v1/vulns/MAL-2026-10405
Aliases
  • GHSA-8vr7-5wqc-fjwv
Published
2026-07-13T06:53:07Z
Modified
2026-08-14T15:00:56Z
Summary
Malicious code in @torbeck/heap (npm)
Details

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

Source: amazon-inspector (b8f88862ffacb671bdaed8521274293d5ef20bafee0deb91cc38cd852daa6a7d)

@torbeck/heap impersonates the legitimate @datastructures-js/heap package: README.md line 1 reads # @datastructures-js/heap, package.json sets homepage/repository/bugs to github.com/datastructures-js/heap and author to Eyas Ranjous <eyas-ranjous@gmail.com>, while the npm scope @torbeck is unrelated. The package re-exports the genuine Heap class so consumers get a working API. Appended to src/heap.js after exports.Heap = Heap; (around line 247) is a heavily obfuscated obfuscator.io payload (two rotated string-array RC4-style decoders, ~580 and ~700 entries, with Function.toString anti-tamper traps and console-method override checks). On require('@torbeck/heap') via the package's index.js main entry, the payload derives an AES key by XORing four hardcoded buffers, decrypts a hidden URL, issues an http/https.request to download a binary into os.tmpdir(), writes a PID lock and.meta.json with a sha256, chmods the file to 0755, and spawns it detached via process.execPath or bash -c with stdio:'ignore', windowsHide:true, and unref() — plus a re-exec wrapper that respawns the parent under a sentinel. Platform-specific branches handle win/linux/mac. There is no version pinning or signature check on the downloaded bytes, the URL is concealed by obfuscation, and the dropped binary's purpose is unrelated to a heap data-structure library. This is a typosquat carrying an install/require-time RCE dropper.

Source: ghsa-malware (343a2b607a8d688e4596c80d14e7aa9d1bb785a187aa9949b789d5cd4d01b0d9)

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": "IN-MAL-2026-009839",
            "import_time": "2026-07-13T07:40:12.305478052Z",
            "modified_time": "2026-07-13T06:53:14Z",
            "sha256": "0999453caf66088321ca8bf3347a0e2c7cc7bc835589da8b6d2c904735d1f4d4",
            "source": "amazon-inspector",
            "versions": [
                "4.3.14"
            ]
        },
        {
            "id": "IN-MAL-2026-009838",
            "import_time": "2026-07-13T07:40:12.227981856Z",
            "modified_time": "2026-07-13T06:53:07Z",
            "sha256": "b8f88862ffacb671bdaed8521274293d5ef20bafee0deb91cc38cd852daa6a7d",
            "source": "amazon-inspector",
            "versions": [
                "4.3.11"
            ]
        },
        {
            "id": "IN-MAL-2026-009840",
            "import_time": "2026-07-13T07:40:12.39331954Z",
            "modified_time": "2026-07-13T06:53:22Z",
            "sha256": "84b533170c48284483245bcf2eb3e05e1b7721ee4b40bac5328cd1466bd08b18",
            "source": "amazon-inspector",
            "versions": [
                "4.3.10"
            ]
        },
        {
            "id": "GHSA-8vr7-5wqc-fjwv",
            "import_time": "2026-08-13T22:11:44.602723708Z",
            "modified_time": "2026-08-13T17:01:39Z",
            "ranges": [
                {
                    "events": [
                        {
                            "introduced": "0"
                        }
                    ],
                    "type": "SEMVER"
                }
            ],
            "sha256": "343a2b607a8d688e4596c80d14e7aa9d1bb785a187aa9949b789d5cd4d01b0d9",
            "source": "ghsa-malware"
        },
        {
            "id": "IN-MAL-2026-017789",
            "import_time": "2026-08-14T14:51:38.684945427Z",
            "modified_time": "2026-08-14T14:36:28Z",
            "sha256": "21930d78f67e79d16ee40b05351e7f811f9d7dc449bd12f529184f646cdf0af1",
            "source": "amazon-inspector",
            "versions": [
                "4.3.8"
            ]
        },
        {
            "id": "IN-MAL-2026-017790",
            "import_time": "2026-08-14T14:51:38.75064498Z",
            "modified_time": "2026-08-14T14:36:37Z",
            "sha256": "94f4fd542157995f428e4db5348392135908ac97f8471fd5bbc1471cfa20883f",
            "source": "amazon-inspector",
            "versions": [
                "4.3.12"
            ]
        }
    ]
}
References
Credits

Affected packages

npm / @torbeck/heap

Package

Name
@torbeck/heap
View open source insights on deps.dev
Purl
pkg:npm/%40torbeck/heap

Affected ranges

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

Affected versions

4.*
4.3.8
4.3.10
4.3.11
4.3.12
4.3.14

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"
    },
    {
        "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": "src/heap.js",
            "sha256": "c0ccf76717c4fbb6bad0405fd18d64a662fd1d88a810e9d8e04e0bf4679821a0",
            "tlsh": "81a31c857eeb30af525221b3512b6186e85d9c5db24c8508f465ccecff9423ce2a67bc"
        },
        {
            "path": "package.json",
            "sha256": "97e8bded23a9d0725301d5dd7bc2d442268b6fdfd821b605b413027d93a3e99e",
            "tlsh": "61116aa8e97e8da30ad469d1a46e15517212588b4c48f84df396033c8f4e66f31f8b1e"
        }
    ],
    "package_integrity": [
        {
            "filename": "heap-4.3.14.tgz",
            "hashes": {
                "sha1": "a0afa5e2b2e6b97ef702903ff4cf3b944db83a37",
                "sha512_sri": "sha512-6aw5nM2QQxymgkuqnKmsOItDqthH6G09dExKKLj3Uyhz+Gn1hF2zmI9yYDA+IpNHJRIVbSDM9oaoo8ApKmeZRQ=="
            }
        }
    ]
}
source
"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/@torbeck/heap/MAL-2026-10405.json"