Supply-chain threat intelligence

Incident detail

criticalnpm·crypto miner·osv

Malicious code in class-synth (npm)

class-synth

Risk score

92

AI summary

Indexed incident for class-synth (npm).

Description

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.

Technical details

Affected versions

=1.0.9=1.0.4=1.0.8=1.0.6=1.0.7=1.0.3=1.0.2=1.0.5

Indicators

  • affected version=1.0.975%
  • affected version=1.0.475%
  • affected version=1.0.875%
  • affected version=1.0.675%
  • affected version=1.0.775%
  • affected version=1.0.375%
  • affected version=1.0.275%
  • affected version=1.0.575%

Timeline

  1. Advisory published
  2. Indexed by ThreatPkg

Related incidents