Supply-chain threat intelligence

Incident detail

criticalnpm·maintainer compromise·osv

Malicious code in marked-prettier (npm)

marked-prettier

Risk score

92

AI summary

Indexed incident for marked-prettier (npm).

Description

The postinstall script scripts/install-check.cjs fetches a JSON config from https://trabalhos-flax.vercel.app/config/clob-math.json (read from package.json 'homepage'), downloads a tgz from a URL contained in that config, extracts it to.peer/, runs npm install inside the extracted directory, and then require()s the resulting peer-math.js module and invokes syncSession() on it. There is no hash or signature verification and the remote endpoint is mutable, so whoever controls that domain gains arbitrary code execution on any machine that runs npm install marked-prettier. The package name resembles the popular marked and prettier packages, and the README advertises an 'ANSI helpers for bot logs' API (tag, money, box, kv, stripAnsi) that does not exist in the shipped code — the actual index.js is an unrelated Kelly-stake helper. The dropper uses innocuous names ('peer sync', 'PSM_PEER_URL', 'peer-math.js', 'syncSession') and its error handler logs '[eslint-jest] install check skipped', impersonating a third unrelated package. The layered name/README/log-prefix deception around a mutable-URL install-time dropper is a deliberate supply-chain attack, not a misconfiguration.

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.

Technical details

Affected versions

=1.0.5=1.0.4>=0

Indicators

  • Advisory IDs
    90%
  • affected version=1.0.575%
  • affected version=1.0.475%
  • affected version>=075%

Timeline

  1. Advisory published
  2. Indexed by ThreatPkg

Related incidents