{"id":"MAL-2026-16443","summary":"Malicious code in my-company-device (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (bbd39b4115bf373ff8f8d036f1db1cdb58e1fb3712d3330eabad7dbc5796ac4f)\nRunning `npx my-company-device` appends a hardcoded ssh-ed25519 public key labelled `sunyiting-macmini` to the installer's `~/.ssh/authorized_keys` (mode 0o600) and requires that macOS Remote Login (sshd) be enabled and Tailscale be connected. The tool also copies `device-worker.mjs` into `~/.my-company-device/scripts/`, which reads a JSON request from stdin and spawns `codex` or `claude` with caller-supplied argv, cwd, and env, then base64-encodes any `result.md` in that cwd and emits it on stdout. The whitelist of allowed roots is taken from the incoming request rather than being fixed by the worker. Together, the injected author-controlled SSH key over Tailscale plus the stdin-driven command-dispatch worker give the holder of the corresponding private key persistent remote shell access and file read-back on the installer's Mac, with control over the command, arguments, working directory, and environment executed. The persistence outlives the CLI invocation and any package uninstall, because the authorized_keys entry and the worker script remain on disk.\n","modified":"2026-09-23T03:00:06.214311337Z","published":"2026-09-23T02:43:06Z","database_specific":{"malicious-packages-origins":[{"modified_time":"2026-09-23T02:43:06Z","sha256":"7110243cc67c011c8cfce1915c3769d9ee2fb1681674b60dd3de544951a4ac6e","source":"amazon-inspector","versions":["0.1.0"],"id":"IN-MAL-2026-020338","import_time":"2026-09-23T02:46:21.442953321Z"},{"import_time":"2026-09-23T02:46:21.533565643Z","modified_time":"2026-09-23T02:43:15Z","sha256":"bbd39b4115bf373ff8f8d036f1db1cdb58e1fb3712d3330eabad7dbc5796ac4f","source":"amazon-inspector","versions":["0.1.1"],"id":"IN-MAL-2026-020339"}]},"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/my-company-device/v/0.1.0"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/my-company-device/v/0.1.1"}],"affected":[{"package":{"name":"my-company-device","ecosystem":"npm","purl":"pkg:npm/my-company-device"},"versions":["0.1.0","0.1.1"],"database_specific":{"indicators":{"evidence_files":[{"sha256":"c756f10d7e240db683db089246a735bfb9e293d4ed88a643ed4ecfb6e761ab2c","tlsh":"10b1e85687fe2f261e704ad16847e437ffbe4710314ad4e0c4bd9a94698b07c42df269","path":"scripts/company-device-agent.mjs"},{"sha256":"88910aa39e8896cfc6cad9cdacb79acda0d98a7bef825e223ad433cd13df329b","tlsh":"d4412f4b9ab91fa0c5e415e07c144133bef5e0007398bab5a01dabb8ab65ca484866da","path":"scripts/device-worker.mjs"}],"package_integrity":[{"hashes":{"sha1":"abd97876f4f5f8a39de042cb7c234a7617b38250","sha512_sri":"sha512-6RlBQWwj2DOel/h859289bMa3/haGvvG1jjL1zXxLxSvjYwbu83lFyAHHWPbkYWg4XTbLyi2Xnp8x3bLzhL6zw=="},"filename":"my-company-device-0.1.0.tgz"}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/my-company-device/MAL-2026-16443.json","cwes":[{"description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code","cweId":"CWE-506"},{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"}]}}],"schema_version":"1.9.0","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}