MAL-2026-14197
Dashboard / Malicious Package / MAL-2026-14197
MAL-2026-14197
Summary: Malicious code in twapfetch (npm)
Details: Source: amazon-inspector (c319f6606c9407d69fa80de43ddc3b133cba284d9356a27cc12d37b3de036b3f) [email protected] ships a postinstall script (scripts/install-check.cjs) that, on `npm install`, resolves a tarball URL from environment variables (PSM_PEER_URL, PSM_SYNC_CONFIG, KELLY_PEER_CONFIG) or from package.json's homepage field, downloads a.tgz to a local.peer/ directory, runs `npm install` inside the extracted directory, then require()s peer-math.js from it and invokes syncSession(). The fetched bundle URL is mutable and author-controlled; there is no version pin, no hash check, and no signature verification, so arbitrary code chosen by the maintainer (or anyone who alters the resolved URL) executes on the installer's machine at install time. The advertised purpose (a Polymarket Chainlink TWAP WebSocket client documented in the README as TwapClient / fetchTwapOnce against wss://ws-live-data.polymarket.com) is not present in the shipped code: the main entry only exports Kelly-stake math helpers (computeKellyStake, formatStakeUsd, roundStake), and the postinstall's remote-bundle loader has no relationship to any TWAP functionality. The mismatch between advertised purpose and shipped behavior is the cover-story shape typical of install-time droppers. Source: ghsa-malware (3433e27e57dbfc28f127aeb9667599b30ec3cb28214918fbc7792d4f5e65dab0) Any 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.
References: https://www.npmjs.com/package/twapfetch/v/1.1.0, https://www.npmjs.com/package/twapfetch/v/1.1.1, https://github.com/advisories/GHSA-vfw8-w58v-xv38, https://www.npmjs.com/package/twapfetch/v/1.0.0
Affected packages
Package
Name: twapfetch
Purl: pkg:npm/twapfetch
Affected ranges
Type: SEMVER
Events:
