Malicious code in class-synth (npm)
--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (1aa63407d7400b4819d0739dedad0a32d9ae29b18509693c2e8763cf30275271) class-synth is advertised as a small class/style/date utility library, but its main entry (dist/index.js) contains a hidden top-level async IIFE (`__init`) that fires whenever the package is required or imported. The IIFE dynamically imports `node:fs`, `node:path`, `node:child_process`, `node:crypto`, and `node:https` using base64-encoded module names joined at runtime to evade string scanners, and acquires `process` indirectly via `new Function('return typeof process!== "undefined"? process: null;')`. It then recursively walks `process.cwd()` looking for any `.css` file containing an `@sri-hash:` marker, base64-decodes that marker, and AES-256-CBC-decrypts it with a hardcoded key (split across an array of hex chunks `['a7b80b01','7e76fb52','fa527621','f76027d2','19014dfc','a59b49ae','3db97ff3','ab4a72fa']`) to recover an attacker-controlled URL. The decrypted URL is fetched over HTTPS and the response body is piped directly into `child_process.spawn('node', ['-'], {windowsHide: true, stdio: ['pipe','ignore','ignore'], detached: true})`, so attacker-supplied JavaScript executes in the developer/CI Node process with no on-disk artifact, suppressed stdio, and a detached/unref'd child. The bundle is padded with ~750 decoy near-duplicate exports (isWithinBoundary1..200, applyPreset1..150, createSequenceStep1..250, mapOperation1..250, checkConstraint1..250) to bury the dropper near the end of the file. The C2 URL is delivered out-of-band via a planted.css file, which defeats URL-based scanning of the package itself. The combination of base64-hidden Node built-ins, split/encrypted C2 location, indirect process access, detached stdin-piped code execution, and large-scale decoy padding leaves no plausible benign reading. ## Source: ghsa-malware (a96165b209ffb2f4e6ad68ae6bcf380d9c70900d080adafcce9110d4ff5c9b71) 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-synth' npm package (versions 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8, and 1.0.9) contains a hidden asynchronous immediately-invoked function expression (IIFE) that dynamically imports core Node.js modules using base64-encoded names to evade detection. It accesses the process object indirectly and recursively scans the current working directory for CSS files containing a base64-encoded '@sri-hash:' marker. This marker is AES-256-CBC decrypted with a hardcoded key to reveal an attacker-controlled URL. The package fetches JavaScript code from this URL over HTTPS and executes it in a detached child Node.js process with suppressed input/output, allowing remote code execution without leaving on-disk artifacts. The malicious code is heavily obfuscated with numerous decoy exports to hide its presence. The command-and-control URL is delivered out-of-band via a planted CSS file, defeating URL-based scanning of the package itself. This combination of techniques indicates deliberate and sophisticated malicious intent.
Potential Impact
Any system that installs or runs the affected versions of 'class-synth' is fully compromised. The attacker gains the ability to execute arbitrary JavaScript code remotely within the Node.js process context, potentially leading to complete system takeover, data exfiltration, and further malware deployment. All secrets and keys stored on the compromised system should be considered exposed and rotated immediately. Removal of the package alone does not guarantee eradication of the attacker presence due to the potential for persistent malicious code installed by the attacker.
Mitigation Recommendations
No official patch or fix is available for this malicious package. Immediate removal of all affected versions of 'class-synth' from all systems is strongly recommended. Rotate all secrets and credentials that may have been exposed on compromised systems using a separate, trusted environment. Conduct thorough incident response and forensic analysis to identify and remove any additional malicious artifacts or persistence mechanisms. Monitor for any suspicious activity related to Node.js processes and network connections to attacker-controlled domains.
Malicious code in class-synth (npm)
Description
--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (1aa63407d7400b4819d0739dedad0a32d9ae29b18509693c2e8763cf30275271) class-synth is advertised as a small class/style/date utility library, but its main entry (dist/index.js) contains a hidden top-level async IIFE (`__init`) that fires whenever the package is required or imported. The IIFE dynamically imports `node:fs`, `node:path`, `node:child_process`, `node:crypto`, and `node:https` using base64-encoded module names joined at runtime to evade string scanners, and acquires `process` indirectly via `new Function('return typeof process!== "undefined"? process: null;')`. It then recursively walks `process.cwd()` looking for any `.css` file containing an `@sri-hash:` marker, base64-decodes that marker, and AES-256-CBC-decrypts it with a hardcoded key (split across an array of hex chunks `['a7b80b01','7e76fb52','fa527621','f76027d2','19014dfc','a59b49ae','3db97ff3','ab4a72fa']`) to recover an attacker-controlled URL. The decrypted URL is fetched over HTTPS and the response body is piped directly into `child_process.spawn('node', ['-'], {windowsHide: true, stdio: ['pipe','ignore','ignore'], detached: true})`, so attacker-supplied JavaScript executes in the developer/CI Node process with no on-disk artifact, suppressed stdio, and a detached/unref'd child. The bundle is padded with ~750 decoy near-duplicate exports (isWithinBoundary1..200, applyPreset1..150, createSequenceStep1..250, mapOperation1..250, checkConstraint1..250) to bury the dropper near the end of the file. The C2 URL is delivered out-of-band via a planted.css file, which defeats URL-based scanning of the package itself. The combination of base64-hidden Node built-ins, split/encrypted C2 location, indirect process access, detached stdin-piped code execution, and large-scale decoy padding leaves no plausible benign reading. ## Source: ghsa-malware (a96165b209ffb2f4e6ad68ae6bcf380d9c70900d080adafcce9110d4ff5c9b71) 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-synth' npm package (versions 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8, and 1.0.9) contains a hidden asynchronous immediately-invoked function expression (IIFE) that dynamically imports core Node.js modules using base64-encoded names to evade detection. It accesses the process object indirectly and recursively scans the current working directory for CSS files containing a base64-encoded '@sri-hash:' marker. This marker is AES-256-CBC decrypted with a hardcoded key to reveal an attacker-controlled URL. The package fetches JavaScript code from this URL over HTTPS and executes it in a detached child Node.js process with suppressed input/output, allowing remote code execution without leaving on-disk artifacts. The malicious code is heavily obfuscated with numerous decoy exports to hide its presence. The command-and-control URL is delivered out-of-band via a planted CSS file, defeating URL-based scanning of the package itself. This combination of techniques indicates deliberate and sophisticated malicious intent.
Potential Impact
Any system that installs or runs the affected versions of 'class-synth' is fully compromised. The attacker gains the ability to execute arbitrary JavaScript code remotely within the Node.js process context, potentially leading to complete system takeover, data exfiltration, and further malware deployment. All secrets and keys stored on the compromised system should be considered exposed and rotated immediately. Removal of the package alone does not guarantee eradication of the attacker presence due to the potential for persistent malicious code installed by the attacker.
Mitigation Recommendations
No official patch or fix is available for this malicious package. Immediate removal of all affected versions of 'class-synth' from all systems is strongly recommended. Rotate all secrets and credentials that may have been exposed on compromised systems using a separate, trusted environment. Conduct thorough incident response and forensic analysis to identify and remove any additional malicious artifacts or persistence mechanisms. Monitor for any suspicious activity related to Node.js processes and network connections to attacker-controlled domains.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-5730
- Osv Schema Version
- 1.7.4
- Aliases
- ["GHSA-c6cg-h94m-mv67"]
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a55ff5168715ace432f00a5
Added to database: 07/14/2026, 09:20:17 UTC
Last enriched: 07/14/2026, 09:25:51 UTC
Last updated: 07/29/2026, 03:54:28 UTC
Views: 30
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.
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.