{"id":"MAL-2026-10199","summary":"Malicious code in polymarket-kelly-math-stake (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (f2cf5ba9cd75b1a773e3a04e6eb45778894e04fd1d55b2e8ad03ae97deb41d16)\npolymarket-kelly-math-stake@3.6.2 runs a postinstall script (scripts/install-check.cjs) that fetches a JSON config from https://jipred.vercel.app/config/clob-math.json, resolves a.tgz bundle URL from that config, downloads the tarball to a temp directory, extracts it into a.peer directory, runs `npm install` inside it, then require()s the extracted peer-math.js and invokes syncSession(). The bundle URL is server-controlled, unpinned, and unverified (no hash or signature check), and can also be overridden through PSM_PEER_URL / PSM_SYNC_CONFIG / KELLY_PEER_CONFIG environment variables. The config indirection through the homepage field lets the operator of jipred.vercel.app swap the executed payload at any time without republishing the npm package. The package's advertised library surface (index.js re-exporting computeKellyStake/formatStakeUsd/roundStake) is unrelated to the install-time behavior, and package.json declares the package as its own dependency — the shipped code is a thin cover-story while the actual executed logic arrives from a mutable third-party endpoint. Installing this package causes arbitrary attacker-controlled code to execute on the installer's machine on every `npm install`.\n\n## Source: ghsa-malware (a15a485d430e971b7b4d8638b535e9e51ca65908d77a93ddfef4b04186dfaaec)\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-394f-8988-57rp"],"modified":"2026-07-13T15:32:00.101374468Z","published":"2026-07-12T15:12:02Z","database_specific":{"malicious-packages-origins":[{"source":"amazon-inspector","modified_time":"2026-07-12T15:12:02Z","import_time":"2026-07-12T15:24:47.90115111Z","id":"IN-MAL-2026-009751","sha256":"f2cf5ba9cd75b1a773e3a04e6eb45778894e04fd1d55b2e8ad03ae97deb41d16","versions":["3.6.2"]},{"ranges":[{"events":[{"introduced":"0"}],"type":"SEMVER"}],"modified_time":"2026-07-13T14:49:00Z","import_time":"2026-07-13T15:14:36.292778188Z","id":"GHSA-394f-8988-57rp","sha256":"a15a485d430e971b7b4d8638b535e9e51ca65908d77a93ddfef4b04186dfaaec","source":"ghsa-malware"}]},"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/polymarket-kelly-math-stake/v/3.6.2"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-394f-8988-57rp"}],"affected":[{"package":{"name":"polymarket-kelly-math-stake","ecosystem":"npm","purl":"pkg:npm/polymarket-kelly-math-stake"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"}]}],"versions":["3.6.2"],"database_specific":{"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/polymarket-kelly-math-stake/MAL-2026-10199.json","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"}],"indicators":{"package_integrity":[{"filename":"polymarket-kelly-math-stake-3.6.2.tgz","hashes":{"sha512_sri":"sha512-i6PxXCVkNfV14HVhVFwK7QQpGiJOjot0+ZABA1SBr4SxXQvcGQ0oln88vojl2g/WQzHhQi2b6/Qus1eTkGYQXg==","sha1":"20e2a6dba911e8ed663614b7abfe029811fe2f1f"}}],"evidence_files":[{"path":"scripts/install-check.cjs","sha256":"3e15f1692c4075cf29cefa94c84d564a95086ab7a6838a97ea25cd02475a282d","tlsh":"6ad1659915a272770bb0e7a4cb53a41eeb6394233511c364f6cdc6952ff6164c213dec"},{"sha256":"afdf804b48f56bdc7a615121dd1a0a6e4cf32010eedd8db732e5c6e556e5cecd","path":"package.json","tlsh":"a5012b37da608e3724b95edd4d691544f5610b0f72b04d1b70fb615c4b72173045b779"}]}}}],"schema_version":"1.7.5","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}