registry  /  @iicp/client  /  0.7.77

@iicp/client@0.7.77

Use the open IICP AI mesh from TypeScript or JavaScript without running a node

AI Security Review

scanned 14d ago · by lpm-firewall-ai

No confirmed malware or install-time attack was found. The main unresolved risk is a user-invoked provider server that performs default-on self-update with a global npm install and process reexec.

Static reason
One or more suspicious static signals were detected.; previous stored version diff introduced dangerous source
Trigger
Running iicp-node serve; optional dependency install only during interactive iicp-node init confirmation
Impact
A running provider node may mutate the global @iicp/client installation and execute the upgraded package without an explicit update command.
Mechanism
default-on runtime self-update via npm install -g plus CLI/network node operations
Attack narrative
When an operator runs iicp-node serve, the CLI starts timers that check npm for @iicp/client/latest. If a newer version is reported and auto-update is not disabled, it spawns npm install -g @iicp/client@latest and reexecs the CLI. This is a risky self-mutating runtime path, but it is tied to the provider-node feature and not triggered on package install or ordinary import.
Rationale
Static inspection supports a warn-level dangerous runtime capability rather than malware: the risky npm install/reexec is real and default-on during serve, but no unconsented lifecycle execution, credential harvesting, or exfiltration path was found.
Evidence
package.jsondist/index.jsdist/cli.jsdist/updater.jsdist/tunnel.jsdist/identity.jsdist/client.jsdist/node.js~/.iicp/operator.json~/.iicp/nodes/<name>.json~/.iicp/state/quick_tunnel_rate_limit.json~/.iicp/state/quick_tunnel_create_gate.json~/.iicp/state/quick_tunnel_create.lock
Network endpoints6
registry.npmjs.org/@iicp/client/latestiicp.network/apiapi.anthropic.comapi.ipify.orgcloudflare-dns.com/dns-query*.trycloudflare.com

Decision evidence

public snapshot
AI called this Suspicious at 86.0% confidence as Dangerous Capability with medium false-positive risk.
Evidence for warning
  • dist/updater.js default-on autoUpdateTick runs npm install -g @iicp/client@latest then reexecs during serve
  • dist/cli.js startProviderAutoUpdate is called by runServe without an explicit update command; opt-out is IICP_AUTO_UPDATE=0
  • dist/cli.js init can run execSync npm install --no-save for optional deps, but only after interactive prompt
  • dist/tunnel.js spawns cloudflared tunnel when serving and tunnel fallback is enabled
Evidence against
  • package.json has no install/preinstall/postinstall lifecycle hooks
  • dist/index.js is a re-export entrypoint with no obvious import-time execution beyond requires
  • Network activity is aligned with IICP SDK/node functions: directory registration/discovery, backend probes, credits, NAT/tunnel checks
  • Identity/token files are stored under ~/.iicp for operator/node operation, not harvested or exfiltrated generically
  • No credential scraping, destructive behavior, persistence outside CLI service generation, or reviewer/prompt manipulation found
Behavioral surface
Source
ChildProcessCryptoDynamicRequireEnvironmentVarsEvalFilesystemNetworkShell
Supply chain
HighEntropyStringsUrlStrings
ManifestNo manifest risk signals triggered.
scanned 42 file(s), 494 KB of source, external domains: 127.0.0.1, api.anthropic.com, api.ipify.org, api6.ipify.org, cloudflare-dns.com, iicp.network, pkg.cloudflare.com, registry.npmjs.org, schemas.xmlsoap.org

Source & flagged code

6 flagged · loading source
dist/tunnel.jsView file
22exports.openQuickTunnel = openQuickTunnel; L23: const node_child_process_1 = require("node:child_process"); L24: const fs = require("node:fs");
High
Child Process

Package source references child process execution.

dist/tunnel.jsView on unpkg · L22
dist/node.jsView file
756// eslint-disable-next-line @typescript-eslint/no-explicit-any L757: this._prom = await eval('import("prom-client")'); L758: this._tasksCounter = new this._prom.Counter({
Low
Eval

Package source references a known benign dynamic code generation pattern.

dist/node.jsView on unpkg · L756
dist/client.jsView file
7exports.IicpClient = void 0; L8: const node_crypto_1 = require("node:crypto"); L9: const errors_js_1 = require("./errors.js");
Medium
Dynamic Require

Package source references dynamic require/import behavior.

dist/client.jsView on unpkg · L7
dist/cli.jsView file
matchType = previous_version_dangerous_delta matchedPackage = @iicp/client@0.7.76 matchedIdentity = npm:QGlpY3AvY2xpZW50:0.7.76 similarity = 0.927 summary = stored previous version shares package body but lacks this dangerous source file
Critical
Previous Version Dangerous Delta

This package version adds a dangerous source file absent from the previous stored version.

dist/cli.jsView on unpkg
2081const _MCP_DANGEROUS = new Set([ L2082: "bash", "sh", "zsh", "fish", "shell", "powershell", "pwsh", "cmd", L2083: "exec", "execute", "run_command", "run", "system", "eval", ... L2092: if (helpFlag) { L2093: process.stdout.write(`usage: iicp-node mcp-gateway [options]\n\n` + L2094: `Bridge a local MCP server into the IICP mesh as a registered provider node.\n\n` + L2095: `Options:\n` + L2096: ` --mcp-url URL IICP_MCP_URL — MCP server base URL (default http://localhost:8001)\n` + L2097: ` --tools NAMES IICP_MCP_TOOLS — comma-separated tool names to advertise (required)\n` +
High
Command Output Exfiltration

Source combines command execution, command-output handling, and outbound requests; review data flow before blocking.

dist/cli.jsView on unpkg · L2081
388try { L389: (0, node_child_process_1.execSync)(`npm install --no-save ${extras.join(" ")}`, { stdio: "inherit" }); L390: process.stdout.write(" ✓ done\n");
High
Runtime Package Install

Package source invokes a package manager install command at runtime.

dist/cli.jsView on unpkg · L388

Findings

1 Critical4 High4 Medium5 Low
CriticalPrevious Version Dangerous Deltadist/cli.js
HighChild Processdist/tunnel.js
HighShell
HighCommand Output Exfiltrationdist/cli.js
HighRuntime Package Installdist/cli.js
MediumDynamic Requiredist/client.js
MediumNetwork
MediumEnvironment Vars
MediumStructural Risk Force Deep Review
LowScripts Present
LowEvaldist/node.js
LowFilesystem
LowHigh Entropy Strings
LowUrl Strings