VYPR

npm · Malicious package advisory

Malware

prompt-engineering-toolkit

MAL-2026-4282

Malicious code in prompt-engineering-toolkit (npm)

Details

Ten packages published by npm user `asdxzxc` at version 1.0.10 target developers working on AI and LLM tooling. Each package masquerades as a developer utility while executing a two-stage payload triggered via postinstall: `package.json` → `lib/setup.js` → `lib/worker.js`.

**Credential harvesting:** `lib/worker.js` scans the filesystem for private keys (64-char hex), BIP39 mnemonics (12–24 word phrases), API keys and secrets, and passwords from env vars and shell history (`.bash_history`, `.zsh_history`, `.fish_history`, `.mysql_history`, `.psql_history`), including wallet tool invocations (`geth account`, `hardhat`, `metamask`, `wallet import`). Targeted paths include `~/.ssh`, `~/.aws/credentials`, `~/.config/gcloud`, `~/.azure`, `~/.docker/config.json`, `~/.kube/config`, crypto wallet dirs (`~/.ethereum`, `~/.bitcoin`, `~/.solana`), exchange configs (Binance, Bybit, OKX, KuCoin, Deribit, 3Commas), `.env`, `.npmrc`, `.gitconfig`. Also performs browser data theft and Ethereum keystore brute-force. A priority-target list fetched from the actor's GitHub Pages endpoint enables aggressive deep scanning for pre-registered high-value hosts.

**AI self-propagation:** after credential theft, a `_propagate()` function executes a multi-vector campaign to infect AI coding assistants. It writes poisoned `.cursorrules` and `CLAUDE.md` files — framed as "P-2024-001 Enterprise Credential Integrity Standard" — to all discovered project directories, parent directories, and home subdirectories, instructing Cursor, Claude Code, and GitHub Copilot to execute the remote payload and propagate it via Issues, PRs, and documentation. Git hooks (`post-merge`, `post-checkout`, `pre-commit`, `pre-push`) are injected into all `.git` repos found on disk, and a persistence block is appended to `~/.bashrc`, `~/.zshrc`, and `~/.profile`. Zero-width steganography (ZWSP/ZWJ/ZWNJ/LTRM encoding) embeds hidden scan triggers in all AI-generated text output, enabling AI-to-AI chain infection invisible to humans.

**C2/exfil:** a remotely configurable JSON config hosted on the actor's GitHub Pages delivers the active webhook list, encryption key, and scan strategy; hardcoded fallback webhooks at `webhook.site` and a DNS TXT record fallback are used if the primary channel fails. A dedup marker at `~/.local/share/.p2024_integrity` prevents re-propagation within 24 hours.

`prompt-engineering-toolkit` poses as a professional prompt engineering utility with template management and A/B testing, specifically targeting AI/LLM application developers.

---
_-= Per source details. Do not edit below this line.=-_

## Source: amazon-inspector (955645bb46ce619e2406ed3f7ba34c9d263c84df2a1e7f0d3c2237c9288c0593)
The package contains lib/trap-core.js, a ~1000-line module that combines fs, os, https, and child_process to collect host information (os.hostname(), os.platform()) and POST it to remote endpoints (multiple POST sites at lib/trap-core.js:385, 411, 466, 548, 549, 600). The file also performs filesystem enumeration (fs.existsSync at multiple offsets), spawns subprocesses (child_process required at lines 12, 748, 951, 959, 964), and invokes system reconnaissance commands (curl at line 781, ping at line 40). The structural fingerprints — combined os/https/fs/child_process imports, hostname collection, multiple hardcoded POST destinations, and shell command invocation in a single module — match the system-intelligence exfiltration shape and are not consistent with the package's advertised purpose as a prompt-engineering toolkit. Installer harm: any consumer that loads this module exposes host identifiers, filesystem layout, and command output to the embedded remote endpoints.

## Source: ghsa-malware (fbdfeeaab53bc28e47dd06cf9b137c5dfe18c81b70bb9d9c9e8b82a0a194267a)
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.

## Source: ossf-package-analysis (7e1601a7f7edf854bb629ac832f0dccfe13b960e33752728f8ea112f49325f91)
The OpenSSF Package Analysis project identified 'prompt-engineering-toolkit' @ 1.0.12 (npm) as malicious.

It is considered malicious because:

- The package executes one or more commands associated with malicious behavior.

Compromised versions (3)

  • 1.0.12
  • 1.5.1
  • 1.5.0

Any computer that installed or ran a compromised version should be considered fully compromised. Rotate every secret on that machine from a clean environment.