NIST deprecates RSA-2048 from 2030. Find every one of them before attackers do.
Malicious package

type-swapnpm

Advisory published Updated

type-swap is a confirmed malicious npm package (MAL-2026-10511) that typosquats a legitimate package to trick installs (malicious version 3.1.3). Do not install it — remove it immediately and rotate any exposed credentials.

Malicious code in type-swap (npm)

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.

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

1 flagged
3.1.3

Indicators of compromise (SHA-256)

6db27d60a7dec38dafef8ed810203dc0130cf340eae162410dfcb7b21a4e2658
b9d1682a8365cd245b7f4173a1d95003f7c9dd41e0d3a0635cae503d6e3eef81

Detection & response playbook

Typosquat
  1. Find it

    Search your lockfiles and build artifacts for type-swap (version 3.1.3).

  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 installed, its post-install payload may already have run. Removing the package does not undo that — check outbound connections and credential use from the install window onward.

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-010353GHSA-w8hw-4vch-mrj4

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.

Explore

type-swap (npm) malicious package — MAL-2026-10511 | O3 Security