Malicious code in magika-js (npm)
The magika-js npm package is a typosquat of Google's legitimate magika library. It contains a postinstall script that collects various host identifiers such as hostname, platform, architecture, Node.js version, package name, npm lifecycle event, and timestamp. This data is sent as JSON to a hardcoded external endpoint without user consent or documented purpose. The package impersonates the legitimate Google project by referencing its GitHub repository. This behavior constitutes malicious code embedded in the package.
AI Analysis
Technical Summary
magika-js is a malicious npm package designed to impersonate Google's magika library by typosquatting its name. Upon installation, its postinstall lifecycle script automatically collects detailed system and environment information from the installer machine and transmits this data to a hardcoded external URL (https://ucjtw03t.instances.poc.jchunt.top/magika-js). This transmission occurs without user opt-in and serves no documented legitimate purpose, indicating a privacy breach and potential reconnaissance activity. The package references the legitimate Google magika GitHub repository to reinforce its impersonation and deceive users.
Potential Impact
The malicious postinstall script compromises user privacy by exfiltrating system and environment details to an attacker-controlled server. This data leakage can facilitate further targeted attacks or profiling of affected systems. There is no indication of direct code execution beyond data exfiltration, and no known exploits in the wild have been reported. However, the presence of such a package in a supply chain can undermine trust and security of dependent projects.
Mitigation Recommendations
Users and developers should avoid installing the magika-js package, especially version 4.1.1, which is known to contain the malicious postinstall script. Since no official patch or remediation is indicated, the best mitigation is to remove this package from dependencies and use the legitimate Google magika library instead. Monitor package sources carefully to avoid typosquatting attacks. Patch status is not yet confirmed — check the vendor advisory or trusted sources for updates.
Malicious code in magika-js (npm)
Description
The magika-js npm package is a typosquat of Google's legitimate magika library. It contains a postinstall script that collects various host identifiers such as hostname, platform, architecture, Node.js version, package name, npm lifecycle event, and timestamp. This data is sent as JSON to a hardcoded external endpoint without user consent or documented purpose. The package impersonates the legitimate Google project by referencing its GitHub repository. This behavior constitutes malicious code embedded in the package.
Affected software
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
Technical Analysis
magika-js is a malicious npm package designed to impersonate Google's magika library by typosquatting its name. Upon installation, its postinstall lifecycle script automatically collects detailed system and environment information from the installer machine and transmits this data to a hardcoded external URL (https://ucjtw03t.instances.poc.jchunt.top/magika-js). This transmission occurs without user opt-in and serves no documented legitimate purpose, indicating a privacy breach and potential reconnaissance activity. The package references the legitimate Google magika GitHub repository to reinforce its impersonation and deceive users.
Potential Impact
The malicious postinstall script compromises user privacy by exfiltrating system and environment details to an attacker-controlled server. This data leakage can facilitate further targeted attacks or profiling of affected systems. There is no indication of direct code execution beyond data exfiltration, and no known exploits in the wild have been reported. However, the presence of such a package in a supply chain can undermine trust and security of dependent projects.
Mitigation Recommendations
Users and developers should avoid installing the magika-js package, especially version 4.1.1, which is known to contain the malicious postinstall script. Since no official patch or remediation is indicated, the best mitigation is to remove this package from dependencies and use the legitimate Google magika library instead. Monitor package sources carefully to avoid typosquatting attacks. Patch status is not yet confirmed — check the vendor advisory or trusted sources for updates.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-14247
- Osv Schema Version
- 1.7.4
- Aliases
- []
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a85b4c2acd9273b492524c1
Added to database: 08/19/2026, 13:50:58 UTC
Last enriched: 08/19/2026, 14:29:45 UTC
Last updated: 08/19/2026, 14:29:45 UTC
Views: 3
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
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
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.