Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
Malicious package

ts-build-optimizenpm

ts-build-optimize is a confirmed malicious npm package (MAL-2026-3774) that steals credentials and exfiltrates sensitive data (malicious versions 1.1.5, 1.1.6, 1.2.0…). Do not install it — remove it immediately and rotate any exposed credentials.

Malicious code in ts-build-optimize (npm)

MAL-2026-3774
Immediate action
Remove the package, then rotate any secrets the build/runtime could reach.
npm uninstall ts-build-optimize

What this malware does

The package masquerades as a TypeScript helper library (README is lifted from Microsoft's tslib and references --importHelpers, __extends, __assign, and a fake github.com/microsoft/ts-build-optimize/releases URL). The shipped index.js has nothing to do with TypeScript helpers: it exports a function buildoptimize whose default arguments are hardcoded to fetch https://verceljs-kappa.vercel.app/icons/23 and pass the response body directly to eval() (index.js:61-63 sets uuri = "https://verceljs-kappa.vercel.app/icons/"; index.js:79 executes eval(JSON.parse(b)); the function is exported at index.js:95). Any consumer who imports this package and calls buildoptimize() — which the name and README imply is a build-time optimizer — will execute arbitrary attacker-controlled JavaScript on the installer/build machine. The Vercel destination is mutable (the author can swap the payload at any time), no hash or signature is verified, and the hosting domain is unrelated to Microsoft or any legitimate tslib publisher. The C2 endpoint serves a benign 6,758-byte PNG decoy when requested without the package's hardcoded bearrtoken: logo HTTP header (so casual scanners and curl see only an image), but returns 53,347 bytes of JSON-wrapped, heavily-obfuscated JavaScript when the header is present. Static analysis of the fetched second stage (sha256 of the raw response body fd082d2406d65aa78d5f1028e11dc23e85d63f07c459fb048d08236a65590b99; sha256 of the JSON-decoded JavaScript source 47d235dad37c7fb86e231822a4c231344cbd006e58b8cb9a013b064c1a521eb8 — captured 2026-05-15, payload is mutable) shows wallet-theft and persistence functionality: references to the Exodus cryptocurrency wallet on macOS (/Library/Application Support/exodus.wallet) and Windows (/AppData/Roaming/Exodus/exodus.wallet); functions named installWindows, uninstallWindows, installMac, uninstallMac, isInstalledWindows, and a macPlistPath constant indicating per-OS persistence install/uninstall machinery; heavy use of child_process.execSync/exec to invoke shell commands; and a top-level setInterval(main, 30000) re-execution loop. The combination of name-squat on a widely-used Microsoft package, README impersonation, header-gated decoy, and a remote-eval primitive that delivers wallet-theft + persistence makes this an unambiguous supply-chain attack.

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.

Malicious versions

5 flagged
1.1.51.1.61.2.01.2.11.2.2

Indicators of compromise (SHA-256)

51c637ab7c13ca2f592502f3444ebb24b291422b6388563d04fb8f7ae9030d5a
d1e5153e45627510761dea66e4b56e8e22e1eab29a671cab42703c9b5a5a5902
b3b9dbaee04ffb27cd7e4206d61221fe1602913d3bcfd7a2bd3353a889032a3f
633df172170dee84fee2b30b56712b60f43715ca863ae059067598d7283081fd
878d7af535588e3d2c21d68ff6686095ed99838e7cf7e2986ef97c73a2ea83dc
4be8b286c06dccd79ec8f318a8f88f497e65c271c7f3e33b11a7ca4d53646b4e

Detection & response playbook

Credential / info stealer
  1. Find it

    Scan your lockfiles (package-lock.json, pnpm-lock.yaml, yarn.lock, requirements.txt, poetry.lock, etc.) and build artifacts for ts-build-optimize (5 malicious versions). O3 Security's supply-chain scanner checks every dependency against known-malicious package intelligence at install time and in CI, flagging ts-build-optimize across your stack and pipelines.

  2. If you installed it — respond

    ts-build-optimize is built to steal secrets, so assume every credential the build or runtime could read is compromised. Remove it from your project and lockfile, then rotate ALL exposed secrets — npm/registry tokens, cloud keys, CI/CD secrets, SSH keys, and any .env values — from a known-clean machine. Audit logs for unauthorized use of those credentials.

  3. Did it already run?

    If ts-build-optimize was ever installed, its post-install/runtime payload may have already executed. O3's L7 egress monitoring and runtime eBPF sensors detect the credential exfiltration or command-and-control callback after install and block the malicious outbound channel, so you catch and contain the actual compromise — not just the presence of the package.

  4. How O3 protects you

    O3 blocks ts-build-optimize before install through its supply-chain scanner, and if it has already run, detects and severs the exfiltration or C2 callback at runtime through L7 egress monitoring and eBPF.

Frequently asked questions

No. ts-build-optimize on npm has been identified as a malicious package (versions 1.1.5, 1.1.6, 1.2.0, 1.2.1, 1.2.2 flagged). It should be removed immediately — do not install or keep it in your dependency tree.

Campaign

IN-MAL-2026-002680IN-MAL-2026-002681IN-MAL-2026-005864IN-MAL-2026-005862IN-MAL-2026-005863GHSA-c22w-53x6-4jf5

References

Credits

  • Amazon Inspector · finder

Detect & block this

O3 blocks ts-build-optimize-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the credential exfiltration and severs the channel.

Explore

ts-build-optimize (npm) malicious package — MAL-2026-3774 | O3 Security