{"id":"MAL-2026-4698","summary":"Malicious code in use-context-selector-tony (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (6dde262b1fecc08fe5853c4ec7ada6c3c3746a6e7afb5bd18c33d5adfa03843c)\nThis package is a name-squat of the popular `use-context-selector` library and ships a postinstall script (`dist/postinstall.js` / `src/postinstall.js`) that, on `npm install`, reads `process.env` and beacons to the hardcoded endpoint `https://almondco.online` via `https.get`. The endpoint is unrelated to any published `use-context-selector` author or infrastructure and is hardcoded in the install-lifecycle script. The combination of (a) name confusion against an established library, (b) a `postinstall` hook firing without consent on every `npm install`, (c) reads of `process.env`, and (d) outbound HTTPS to an attacker-controlled domain matches the standard install-time environment-exfiltration pattern.\n\n## Source: ghsa-malware (01c636bfaa78759b1c1360004597e606219439a0e5945ea4a06e5fac052cede4)\nAny 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.\n","aliases":["GHSA-99hx-q4mr-cfh7"],"modified":"2026-06-10T15:31:30.547351463Z","published":"2026-05-20T07:54:14Z","withdrawn":"2026-05-26T22:13:04Z","database_specific":{"malicious-packages-origins":[{"id":"IN-MAL-2026-003497","modified_time":"2026-05-20T07:54:14Z","versions":["2.0.5"],"source":"amazon-inspector","sha256":"6dde262b1fecc08fe5853c4ec7ada6c3c3746a6e7afb5bd18c33d5adfa03843c","import_time":"2026-05-26T05:50:44.245978482Z"},{"source":"ghsa-malware","sha256":"01c636bfaa78759b1c1360004597e606219439a0e5945ea4a06e5fac052cede4","import_time":"2026-06-10T15:25:13.631415052Z","id":"GHSA-99hx-q4mr-cfh7","modified_time":"2026-06-10T13:55:05Z","ranges":[{"type":"SEMVER","events":[{"introduced":"0"}]}]}]},"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/use-context-selector-tony/v/2.0.5"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-99hx-q4mr-cfh7"}],"affected":[{"package":{"name":"use-context-selector-tony","ecosystem":"npm","purl":"pkg:npm/use-context-selector-tony"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"}]}],"versions":["2.0.5"],"database_specific":{"indicators":{"package_integrity":[{"hashes":{"sha512_sri":"sha512-a+Wy2F1qXjSDYjH9lihoTHD4GGECWwi9uQSD4/ffEMvlSBnvims4Ykbn3uz3PUpgfhffNyvXf0MQkjXIXPVVVw==","sha1":"d2aabab79092c2dedc9f598634269727676969e7"},"filename":"use-context-selector-tony-2.0.5.tgz"}],"evidence_files":[{"path":"dist/postinstall.js","sha256":"9dfd6663c1a1d8a452cb356580a060542777b173393f7626b789c15ae10baa99","tlsh":"9fb111d8b9f763390397f1bc464fa50af7ab64032229c511bd5d83603f9127483b2ae9"},{"sha256":"bcb1903373b96db120987807c4fe38d43aad60fb2e8c20e7299a2744e4540cc8","tlsh":"caa124d8b5f6733943d5a1b8024f960af79b64033269c961fe9e83607f91364c3b18e9","path":"src/postinstall.js"}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/withdrawn/npm/use-context-selector-tony/MAL-2026-4698.json","cwes":[{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"},{"description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code","cweId":"CWE-506"}]}}],"schema_version":"1.7.5","credits":[{"name":"Amazon Inspector","contact":["actran@amazon.com"],"type":"FINDER"}]}