MAL-2026-6718

See a problem?
Import Source
https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/test-pkg-yarn/MAL-2026-6718.json
JSON Data
https://api.osv.dev/v1/vulns/MAL-2026-6718
Aliases
  • GHSA-r653-6655-p467
Published
2026-07-01T20:47:51Z
Modified
2026-08-20T01:15:14Z
Summary
Malicious code in test-pkg-yarn (npm)
Details

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

Source: amazon-inspector (40b74339843ee482f3f135dd43e855f1f30758e20857333e0e6153748888769a)

package.json declares bin: { "node": "./shim.js" }, causing npm/yarn to symlink node in node_modules/.bin (and in a system bin dir on global install) to a package-controlled script. Subsequent invocations of node resolved through that PATH entry execute shim.js instead of the real Node.js runtime, redirecting any tooling that expects node to attacker-controlled code. In addition, scripts.postinstall runs bun shim.js || node shim.js, and shim.js unconditionally invokes OS commands at install time via child_process.execSync — spawning a GUI calculator (calc on Windows, gnome-calculator on Linux, open -a Calculator on macOS), opening a URL in the user's browser, and writing a marker file to /tmp/.bun-npm-pwned. The package self-identifies as 'BunnyHijack PoC - yarn variant' with the console message '[!] PATH POISONED - test-pkg-yarn just hijacked your node command.' Although framed as a proof-of-concept and not currently exfiltrating data, the behavior is real install-time code execution against any developer who installs the package and a persistent hijack of the node command in PATH.

Source: ghsa-malware (48a8aeea873fbdd85454d98cc80645d57e3f34365a075242704bbffd2ccb8c21)

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-007897",
            "import_time": "2026-07-01T21:04:20.755909312Z",
            "modified_time": "2026-07-01T20:47:51Z",
            "sha256": "11e7c03fcf57c76835129d9a0c35cc8b0ad262e164929fed2b0452f2d83eb44f",
            "source": "amazon-inspector",
            "versions": [
                "1.0.2"
            ]
        },
        {
            "id": "IN-MAL-2026-007899",
            "import_time": "2026-07-01T21:04:20.868827675Z",
            "modified_time": "2026-07-01T20:48:08Z",
            "sha256": "40b74339843ee482f3f135dd43e855f1f30758e20857333e0e6153748888769a",
            "source": "amazon-inspector",
            "versions": [
                "1.0.1"
            ]
        },
        {
            "id": "IN-MAL-2026-007898",
            "import_time": "2026-07-01T21:04:20.787779869Z",
            "modified_time": "2026-07-01T20:47:57Z",
            "sha256": "c94364f82778798bd6d381c0359adb0f0eb92676036c117640d0370810b7ab2e",
            "source": "amazon-inspector",
            "versions": [
                "1.0.0"
            ]
        },
        {
            "id": "GHSA-r653-6655-p467",
            "import_time": "2026-08-20T01:06:54.124333655Z",
            "modified_time": "2026-08-19T15:20:04Z",
            "ranges": [
                {
                    "events": [
                        {
                            "introduced": "0"
                        }
                    ],
                    "type": "SEMVER"
                }
            ],
            "sha256": "48a8aeea873fbdd85454d98cc80645d57e3f34365a075242704bbffd2ccb8c21",
            "source": "ghsa-malware"
        }
    ]
}
References
Credits

Affected packages

npm / test-pkg-yarn

Package

Name
test-pkg-yarn
View open source insights on deps.dev
Purl
pkg:npm/test-pkg-yarn

Affected ranges

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

Affected versions

1.*
1.0.0
1.0.1
1.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"
    },
    {
        "cweId": "CWE-506",
        "description": "The product contains code that appears to be malicious in nature.",
        "name": "Embedded Malicious Code"
    }
]
indicators
{
    "evidence_files": [
        {
            "path": "package.json",
            "sha256": "0a5b47939c9280af09b961619c386fea57ca3b197dd5003b41ceca244e89bbc7",
            "tlsh": "dbd02b1088b1577325cd38905d6da403673c4b4780043c2c53d7119cab4a7bb08b9255"
        },
        {
            "path": "shim.js",
            "sha256": "3a0197615cc4fd1bbea22a9355a5d69fdbfe7a23f2a21c5a5afc17b4e6b5f6fa",
            "tlsh": "3f316062c2e193b16ef619c2568b443175abdaa37240ffa4f29ec2225f4901203f74b8"
        }
    ],
    "package_integrity": [
        {
            "filename": "test-pkg-yarn-1.0.2.tgz",
            "hashes": {
                "sha1": "932e1e7951721bf60858bb5db11e58073c676b1e",
                "sha512_sri": "sha512-ZsZYjMO1aXwPqfM07+ryLjfRDcXPnQ/ZvvfsZrSpGi4Kixj+NU6EfcJfwRhtJUK0wdmmiIdHUoPx26tMDvYMCg=="
            }
        }
    ]
}
source
"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/test-pkg-yarn/MAL-2026-6718.json"