Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

Malicious code in type-swap (npm)

0
Critical
Published: 07/13/2026 (07/13/2026, 22:17:10 UTC)
Source: GCVE Database
Product: type-swap

Description

The npm package 'type-swap' version 3.1.3 contains malicious code that executes a concealed detached child process. This process fetches and executes remote JavaScript code, enabling arbitrary code execution within the installer's Node environment. The package impersonates a legitimate logging library to evade detection. Any system with this package installed should be considered fully compromised, and all secrets and keys on that system must be rotated immediately. Removal of the package does not guarantee elimination of all malicious components.

Affected software

npmghsa
type-swap
Affected versions
=3.1.3

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/14/2026, 09:46:27 UTC

Technical Analysis

The 'type-swap' npm package version 3.1.3 exports a middleware factory that spawns a detached child process running 'lib/caller.js', which performs an HTTPS GET request to a remote URL to retrieve a JavaScript payload embedded in a cookie field. This payload is executed dynamically using the Function constructor with 'require' bound, allowing arbitrary code execution in the Node.js process. Additional remote endpoints are stored base64-encoded in a fake environment variable, facilitating staged payload delivery. The package and its README falsely impersonate an unrelated logging library to conceal its malicious intent.

Potential Impact

Systems with 'type-swap' version 3.1.3 installed are fully compromised due to arbitrary remote code execution capabilities granted to the attacker. This can lead to complete system takeover, exposure of secrets, keys, and sensitive data. The attacker may maintain persistence beyond package removal, making remediation complex and urgent.

Mitigation Recommendations

Immediate removal of the 'type-swap' package version 3.1.3 is required. All secrets, keys, and credentials stored on the compromised system must be rotated from a separate, trusted device. Due to the high risk of full system compromise, a thorough incident response and forensic analysis should be conducted. No official patch or fix is available; therefore, avoid using this package version entirely.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
MAL-2026-10511
Osv Schema Version
1.7.4
Aliases
["GHSA-w8hw-4vch-mrj4"]
Ecosystems
["npm"]
Database Specific Severity
null
Cvss Version
null

Threat ID: 6a55ff8a68715ace432f47aa

Added to database: 07/14/2026, 09:21:14 UTC

Last enriched: 07/14/2026, 09:46:27 UTC

Last updated: 07/23/2026, 02:27:30 UTC

Views: 9

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses