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

type-swapnpm

Malicious code in type-swap (npm) Remove it immediately and rotate any exposed credentials.

MAL-2026-10511
Immediate action
Remove the package, then rotate any secrets the build/runtime could reach.
npm uninstall type-swap

What this malware does

The package's declared main entry (index.js) exports a middleware factory that, when invoked by a consumer, spawns lib/caller.js as a detached child process with stdio ignored and unref()'d, concealing it from the parent. lib/caller.js performs an HTTPS GET to https://jsonhosting.com/api/json/e16583b1/raw, extracts a JavaScript payload from a cookie field in the response, and executes it via new Function.constructor("require", s)(require), granting the remote host arbitrary code execution in the installer's Node process with require bound. Additional remote endpoints (https://jsonkeeper.com/b/XRGF3 in lib/caller.js and https://jsonkeeper.com/b/4NAKK in lib/const.js) are stored base64-encoded under a fake process.env object keyed as DEV_API_KEY, staged for the fetched payload. The package name and README impersonate an unrelated logging library.

Malicious versions

1 flagged
3.1.3

Indicators of compromise (SHA-256)

6db27d60a7dec38dafef8ed810203dc0130cf340eae162410dfcb7b21a4e2658

Detection & response playbook

Typosquat
  1. Find it

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

  2. If you installed it — respond

    type-swap is a typosquat — you almost certainly intended a legitimately-named package. Remove type-swap, install the correct package, and rotate any secrets exposed during the install since post-install scripts may have already run.

  3. Did it already run?

    If type-swap 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 type-swap 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. type-swap on npm has been identified as a malicious package (version 3.1.3 flagged). It should be removed immediately — do not install or keep it in your dependency tree.

Campaign

IN-MAL-2026-010353

References

Credits

  • Amazon Inspector · finder

Detect & block this

O3 blocks type-swap-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the malicious outbound activity and severs the channel.