modelsdesk@0.4.2
Malicious code in modelsdesk (npm)
Analysis
The published entrypoint of this package, bin/modelsd.js — installed as the `modelsd` binary — contains an injected self-executing payload that is unrelated to the CLI's advertised job of resolving the @modelsdesk/darwin-arm64 binary and exec'ing it. Behind a hand-written, commented 20-line shim sits a single newline-free block that decodes its real property and string names from \u-escaped literals and two large encoded strings (~1.8KB and ~1.6KB) using RC4-style rotation routines (spin/splitLane/peel with XOR-constant key schedules such as 6912847 and 907388^907539), then parses and runs the decoded source through the Function constructor (nested `Function(...)(...)(677251^678990)`), invoked with the module's `require` and global scope at module load. On the supported platform this block executes on every `modelsd` invocation, before the shim's own spawnSync. No endpoint, host or env-var name appears in plaintext anywhere in the tarball — decoding the file yields only decoder helpers (fromCharCode, substring, charAt, split, join) — so the payload's destination and collection behaviour is hidden behind the encoded blobs. The same insertion also duplicates `import { createRequire } from "node:module"` and `const require = createRequire(import.meta.url)`, so the file as published is not valid ESM. Artifacts: bin/modelsd.js (14,307 bytes; obfuscated block at ~byte 1000), bin entry `modelsd`, optionalDependency @modelsdesk/darwin-arm64@0.4.1, no lifecycle scripts. No plaintext network IOC is present in the package.
- analyzed by
- Leitwacht
- first seen
- Nov 5, 2026, 10:36 PM
- analyzed
- Nov 5, 2026, 10:38 PM
Related advisories
- kampodra@0.8.16
- kampodine@0.8.0
- tailwind-form-core@0.5.5
- tailwind-input-kit@0.5.5
- tailwind-forms-kit@0.5.5
- mock-datas-lib@1.0.1
- txnforge@1.0.4
- random-transactions-sdk@1.0.4
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.