@atedone/workspace-context@0.0.12
Malicious code in @atedone/workspace-context (npm)
Analysis
This package silently installs shell persistence the moment it is loaded: requiring @atedone/workspace-context runs a hidden synchronous worker that modifies the current user's shell startup file so its own script is sourced by every future interactive shell. On require, index.js calls initialize() in lib/state.js, which resolves the victim's home directory from HOME and the shell from SHELL, targeting ~/.zshrc when the shell is zsh and ~/.bashrc otherwise. To run its worker without touching child_process, state.js aliases process as "platform", builds the API names from split string arrays at runtime ("bin"+"ding", "sp"+"awn"+"_"+"sync", "sp"+"awn"), and invokes process.binding('spawn_sync') via Reflect.apply with node as the child, passing projectRoot, homeDirectory and profilePath as arguments, windowsHide enabled. The spawned lib/worker.js writes: - ~/.workspace-context/shell-init.sh — exports WORKSPACE_CONTEXT_ACTIVE=1 and WORKSPACE_CONTEXT_ROOT="$HOME/.workspace-context", and appends "workspace-context shell integration active" to ~/.workspace-context/shell-session.log on every shell start. - An appended line in the user's profile (~/.zshrc or ~/.bashrc) of the form [ -f "$HOME/.workspace-context/shell-init.sh" ] && . "$HOME/.workspace-context/shell-init.sh" — added once if not already present, with no notification to the user. - ~/.workspace-context/shell-integration-receipt.json — recording package name and version, project root, home directory, profile path, script path, session log path, pid, parent pid, and the runtime executable name. The package also creates a ~/.workspace-context/state.json in the project root on load. Its README claims only that it "refreshes a lightweight shell integration entry", and the manifest declares no lifecycle hook or bin, so nothing in package metadata shows that loading the module edits the user's shell profile. Persistence artifacts: ~/.workspace-context/shell-init.sh, ~/.workspace-context/shell-session.log, ~/.workspace-context/shell-integration-receipt.json, plus the appended source line in ~/.zshrc or ~/.bashrc. No network destination is contacted by this version.
- analyzed by
- Leitwacht
- first seen
- Nov 3, 2026, 05:20 AM
- analyzed
- Nov 3, 2026, 05:20 AM
Related advisories
- @atedone/workspace-context@0.0.24 same package
- grafeno-core@1.0.0
- spc-grafeno@1.0.0
- wormgpt-cli@1.0.1
- streak-metrics-math@1.0.1
- streak-metrics-core@1.0.0
- @epsteinlovekids483/crossmint-wallets-sdk-pentest@1.0.0-pentest
- base58-cli@1.0.0
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.