Malicious code in @types-beta/sdk (npm)
The npm package @types-beta/sdk (versions 0.1.0–0.1.3) is a supply-chain dropper that impersonates the trusted @types/DefinitelyTyped namespace. It bundles a Windows executable (nanocache.exe) that executes at import time, establishing a persistent remote-access agent with command-and-control capabilities.
- Disclosed
- Last updated
- Blast radius
- Any Windows developer or CI/CD system that installed or transitively depended on @types-beta/sdk versions 0.1.0–0.1.3; execution occurs at import time without requiring installation hooks.
- Ecosystems
- Attack vectors
- Affected entities
- @types-beta/sdk · 0.1.0, 0.1.1, 0.1.2, 0.1.3
The npm package @types-beta/sdk is a malicious supply-chain dropper designed to impersonate the trusted @types (DefinitelyTyped) namespace. Versions 0.1.0 through 0.1.3 were live on npm at the time of reporting.
The package bundles a Windows executable (vendor/nanocache.exe) that executes as an import-time side effect. The dist/index.js file calls init() at module load; on Windows systems, this spawns the bundled binary via Node's child_process module with detached process, suppressed stdio, and hidden window flags. No lifecycle install hook is required—simply importing the package (directly or transitively) triggers execution on Windows.
Static analysis of the bundled binary reveals a WinHTTP WebSocket-based remote-access agent. It dials out to a command-and-control server, maintains a persistent auto-reconnecting channel using WinHttpConnect, WinHttpWebSocketSend, and WinHttpWebSocketReceive APIs, executes remote commands, and spawns an interactive PowerShell session. Embedded strings include [agent] Connecting to %ls:%d (secure=%d), [+] Connected client=%s server=%ls, [>] cmd: %s, [shell] PowerShell session started (UTF-8, pipeline mode), and [-] Disconnected, reconnecting in %dms... for resilience.
The package was detected and classified independently by codelake Research from the live npm feed and was not present in OSV or GHSA at the time of reporting.
Indicators of compromise
- Packages
- @types-beta/sdk@0.1.0
- @types-beta/sdk@0.1.1
- @types-beta/sdk@0.1.2
- @types-beta/sdk@0.1.3
Remediation
- Immediately remove @types-beta/sdk versions 0.1.0–0.1.3 from all package.json files and lock files
- Audit npm install logs and CI/CD execution logs for any systems that may have installed or imported the package
- On Windows systems where the package was installed, scan for execution of nanocache.exe and review process creation logs for suspicious child_process spawning
- Review network logs for outbound WebSocket connections to unknown command-and-control servers
- Regenerate credentials and secrets on any affected development or CI/CD systems
- Use npm audit to identify transitive dependencies on @types-beta/sdk and remove them
- Consider using npm package provenance verification and namespace scoping policies to prevent typosquatting of trusted namespaces like @types
Sources
- GitHub Advisory GHSA-j9jc-8h3g-qqrx · GitHub Advisory Database
Cite this entry
"Malicious code in @types-beta/sdk (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed August 3, 2026; last updated August 3, 2026. https://supplychainattack.org/incident/malicious-code-in-types-beta-sdk-npm-1mugcp
Suggest a correction
Found an error or have a newer source? Corrections to factual errors take priority over new entries.
Related incidents
- resolvedcritical
Malicious code in @dexwilt/node-fetch (npm)
The @dexwilt/node-fetch npm package is a typosquatting attack impersonating the legitimate node-fetch project. Its CommonJS entry point contains obfuscated malicious code that downloads and executes a remote binary payload.
npmCompromised packageTyposquatting - containedcritical
Malicious code in redis-type-xyz (npm)
redis-type-xyz is a malicious npm package that impersonates Redis OM by copying its metadata while substituting a known-malicious ulid-xyz dependency. Installation triggers a postinstall hook that establishes C2 communication and enables system compromise including persistence and arbitrary code execution.
npmCompromised packageTyposquattingDependency confusion - containedcritical
Malicious code in @ai_/autoprefixers (npm)
@ai_/autoprefixers is a typosquat of the legitimate autoprefixer package that executes arbitrary attacker-controlled shell commands on installation. The malicious code fetches encrypted payloads from remote C2 servers and decrypts them using a hardcoded key suffix before execution via child_process.exec.
npmTyposquattingCompromised package - containedcritical
Malicious code in chain-analyze (npm)
The npm package chain-analyze contained malicious code that executed arbitrary Node.js commands on installation. The package impersonated the official Theta blockchain SDK and used a split-package design with a dependency (chain-manager) to hide encrypted payload from scanners.
npmCompromised packageTyposquatting