MAL-2026-11125Malicious code in api-rust-sdk (npm)
| Ecosystem | Package | Version |
|---|---|---|
| npm | api-rust-sdk | 2.1.6 |
{"modified":"2026-07-28T13:28:53Z","published":"2026-07-28T13:28:53Z","schema_version":"1.7.4","id":"MAL-2026-11125","summary":"Malicious code in api-rust-sdk (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (268179cffa6aef31ad248757e61fc892cb826bde059502b3e2c3a74277951e05)\nOn npm install, the package's postinstall hook (`node test.js`) executes two payloads against the installer host. First, it fetches an attacker-controlled SSH public key from http://95.216.118.146:3001/api/ssh-key and appends it to ~/.ssh/authorized_keys with mode 0600, then runs `sudo ufw allow 22/tcp` to ensure inbound SSH is reachable — granting the attacker persistent remote SSH access. Second, it walks process.cwd() for files matching id.json, config.toml, Config.toml, env, and.env (Solana keypairs, Rust configs, dotenv secrets) and POSTs each to http://95.216.118.146:3000/api/v1 prefixed with the installer's $USER. Third, it fetches remote scan/block patterns from http://95.216.118.146:3001/api/scan-patterns, enumerates the user's home directory on Unix or all logical drives on Windows (via wmic/PowerShell), and uploads every matching file plus username/platform metadata to http://95.216.118.146:3001/api/v1. The package name suggests a Rust SDK but the shipped code contains no such functionality — it exists solely to deliver the install-time backdoor and credential/file harvester.\n","affected":[{"package":{"ecosystem":"npm","name":"api-rust-sdk"},"versions":["2.1.6"],"database_specific":{"cwes":[{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"}],"indicators":{"evidence_files":[{"path":"index.js","sha256":"816709b97cc4a1c5c0943813d804c3e8dee9e940bfa808bf4b86ddb10fcc523c","tlsh":"0b02624c96fb2a21c2b371ac465f1406b59ac0033949cd91b6cc93546f8f93d69f2e9e"},{"path":"package.json","sha256":"68916782cff663cb67bbf40278becb1a208de81361b320ec8031caa6b996afce","tlsh":"8ef06d27cb589e6358f135a9287c061bf691932f5104880f35bd665c4fb66374486f2e"}],"package_integrity":[{"filename":"api-rust-sdk-2.1.6.tgz","hashes":{"sha1":"446f4528d0e9b93a84c6cb42a41f0d88adbaefe3","sha512_sri":"sha512-6WK2R7Nt3FQKV7zE3gnamNkGNZiNf8IgxegeS70gbongxwTT6xP2nnwo6rFt6nwfekzhxTqv/TgIWiMO/t0uiA=="}}]}}}],"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/api-rust-sdk/v/2.1.6"}],"credits":[{"name":"Amazon Inspector","type":"FINDER","contact":["inspector-research@amazon.com"]}],"database_specific":{"malicious-packages-origins":[{"id":"IN-MAL-2026-010864","import_time":"2026-07-28T14:19:56.376010277Z","modified_time":"2026-07-28T13:28:53Z","sha256":"268179cffa6aef31ad248757e61fc892cb826bde059502b3e2c3a74277951e05","source":"amazon-inspector","versions":["2.1.6"]}]}}数据来源:OpenSSF Malicious Packages · Apache-2.0