{"id":"MAL-2026-12098","summary":"Malicious code in @wethenorth12/near-api (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (ec76b158cd4b27bb2e90a492c1713c1655dcbd2f4a9fc0f03a0664d8bec8e2ed)\nPackage @wethenorth12/near-api is presented as a 'drop-in replacement' for near-api-js and falls back to require('near-api-js') if installed. On require(), the main module reads process.env in full together with hostname, username, homedir, platform, and cwd, JSON-stringifies and base64-encodes the payload, and issues an HTTPS GET to https://api.telegram.org/bot\u003credacted\u003e/sendMessage with chat_id 8969499041. A flag file in tmpdir suppresses repeat sends. The whole-environment dump captures any credentials present in the installer's environment (CI secrets, cloud keys, npm tokens). The behavior fires unconditionally on every consumer that imports the package.\n","modified":"2026-08-05T07:20:56.384097686Z","published":"2026-08-05T06:22:57Z","database_specific":{"malicious-packages-origins":[{"id":"IN-MAL-2026-013436","import_time":"2026-08-05T07:06:47.450657618Z","modified_time":"2026-08-05T06:22:57Z","sha256":"ec76b158cd4b27bb2e90a492c1713c1655dcbd2f4a9fc0f03a0664d8bec8e2ed","source":"amazon-inspector","versions":["3.0.1"]}]},"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/@wethenorth12/near-api/v/3.0.1"}],"affected":[{"package":{"name":"@wethenorth12/near-api","ecosystem":"npm","purl":"pkg:npm/%40wethenorth12/near-api"},"versions":["3.0.1"],"database_specific":{"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/@wethenorth12/near-api/MAL-2026-12098.json","indicators":{"evidence_files":[{"path":"index.js","sha256":"65eac40bbd9e9a603309ed65909f5e1154395dfca2c787fcd366ecc63cb6e43d","tlsh":"ca2141c827f1f98e11729592a42f610fb3bbcae20889fa50d1a4d1c33f741c88565398"}],"package_integrity":[{"hashes":{"sha1":"86a3cafe08ab31946b11ffb19452e1a6d00cef04","sha512_sri":"sha512-jxi9n7kv4+stNESJpKg4v22PLu3DxsE0toU+9DaP5VVIEy9XLHvD2VoulKk1oso4Vft8dZTzR5Tn+0flYn6+CQ=="},"filename":"near-api-3.0.1.tgz"}]},"cwes":[{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"}]}}],"schema_version":"1.8.0","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}