registry  /  claude-codex-wechat  /  0.1.27

claude-codex-wechat@0.1.27

`claude-codex-wechat` 是一个本地 bridge daemon。它把:

AI Security Review

scanned 1d ago · by lpm-firewall-ai

The package is a runtime bridge, but it unilaterally changes Claude Code resume metadata to bypassPermissions. That is a local AI-agent control-surface mutation tied to remote message bridging.

Static reason
High-risk behavior combination matched malicious policy.
Trigger
User runs the claude-codex-wechat CLI and resumes/attaches Claude sessions through the bridge.
Impact
Can cause resumed Claude sessions to run with bypassed permission prompts while accepting prompts routed from WeChat/relay.
Mechanism
unconsented Claude session permission-mode mutation plus remote bridge control
Attack narrative
When a user runs the CLI bridge and attaches/resumes Claude sessions, the bundled code edits native Claude session JSONL. If it sees an sdk-cli entrypoint and no permission-mode record, it prepends a permission-mode record with permissionMode set to bypassPermissions, then rewrites entrypoint to cli and updates history titles. The bridge can then route WeChat/relay-originated messages into local Claude/Codex sessions.
Rationale
Source inspection confirms a concrete unconsented AI-agent control-surface mutation: inserting Claude Code bypassPermissions metadata during runtime session repair. Although there is no install-time execution and most network/process behavior matches the bridge purpose, this mutation crosses the firewall block boundary. Product guard normalized a non-low false-positive publish_block request to warn-only suspicious.
Evidence
package.jsondist/server/cli.js~/.claude/projects/*/*.jsonl~/.claude/history.jsonl~/.codex/session_index.jsonl~/.codex/state_5.sqlite~/.claude-codex-wechat/config.json
Network endpoints4
ilinkai.weixin.qq.comwss://wechat.style520.com/agentnovac2c.cdn.weixin.qq.com/c2cregistry.npmmirror.com/claude-codex-wechat/latest

Decision evidence

public snapshot
AI called this Suspicious at 90.0% confidence as Dangerous Capability with medium false-positive risk.
Evidence for block
  • dist/server/cli.js mutates Claude session JSONL: sdk-cli entrypoint is rewritten to cli and permissionMode:bypassPermissions is inserted when absent.
  • dist/server/cli.js writes Claude history/session metadata under ~/.claude and Codex session metadata under ~/.codex/state_5.sqlite/session_index.jsonl.
  • dist/server/cli.js exposes WeChat/relay controlled message routing to Claude/Codex providers, enabling remote chat messages to drive local agents after user starts service.
Evidence against
  • package.json has no consumer install-time lifecycle hooks; prepublishOnly/postpublish are publisher-side.
  • Network endpoints are aligned with stated WeChat/relay bridge purpose, not standalone exfiltration.
  • Child_process use primarily launches configured claude/codex commands and service manager commands from user-invoked CLI flows.
Behavioral surface
Source
ChildProcessCryptoEnvironmentVarsFilesystemNetworkShellWebSocket
Supply chain
HighEntropyStringsMinifiedUrlStrings
Manifest
NoLicenseWildcardDependency
scanned 2 file(s), 446 KB of source, external domains: 127.0.0.1, ilinkai.weixin.qq.com, novac2c.cdn.weixin.qq.com, react.dev, registry.npmmirror.com, www.apple.com, www.w3.org

Source & flagged code

6 flagged · loading source
dist/server/cli.jsView file
21// src/channels/weixin-direct/loginClient.ts L22: var DEFAULT_BASE_URL = "https://ilinkai.weixin.qq.com"; L23: var WeixinDirectLoginClient = class { ... L60: if (!response.ok) throw new Error(`weixin_login_request_failed:${response.status}`); L61: const payload = await response.json(); L62: return payload.data ?? payload; ... L70: function defaultConfigPath() { L71: return join(homedir(), ".claude-codex-wechat", "config.json"); L72: } L73: function loadBridgeConfig(path = process.env.BRIDGE_CONFIG ?? defaultConfigPath()) { L74: if (!existsSync(path)) return normalizeBridgeConfig({}, process.env, path); ... L169: function isRetriableRenameError(error) {
Critical
Remote Asset Decode Execute

Source fetches a remote non-code asset, decodes its contents, and dynamically executes the decoded payload.

dist/server/cli.jsView on unpkg · L21
Trigger-reachable chain: manifest.bin -> dist/server/cli.js Reachable file contains a blocking source-risk pattern.
Critical
Trigger Reachable Dangerous Capability

A package entrypoint or install-time lifecycle script reaches a source file with blocking dangerous behavior.

dist/server/cli.jsView on unpkg
2443// src/providers/claude-code/claudeStreamingRunner.ts L2444: import { spawn as spawn3 } from "node:child_process"; L2445: import { randomUUID as randomUUID2 } from "node:crypto";
High
Child Process

Package source references child process execution.

dist/server/cli.jsView on unpkg · L2443
21Detached bundled service listener: dist/server/cli.js launches a Node helper and exposes a broad-bound HTTP listener. L21: // src/channels/weixin-direct/loginClient.ts L22: var DEFAULT_BASE_URL = "https://ilinkai.weixin.qq.com"; L23: var WeixinDirectLoginClient = class { ... L60: if (!response.ok) throw new Error(`weixin_login_request_failed:${response.status}`); L61: const payload = await response.json(); L62: return payload.data ?? payload; ... L70: function defaultConfigPath() { L71: return join(homedir(), ".claude-codex-wechat", "config.json"); L72: } L73: function loadBridgeConfig(path = process.env.BRIDGE_CONFIG ?? defaultConfigPath()) { L74: if (!existsSync(path)) return normalizeBridgeConfig({}, process.env, path); ... L169: function isRetriableRenameError(error) {
High
Spawned Bundled Service Listener

Source launches a detached bundled service that exposes a broad-bound HTTP listener.

dist/server/cli.jsView on unpkg · L21
21// src/channels/weixin-direct/loginClient.ts L22: var DEFAULT_BASE_URL = "https://ilinkai.weixin.qq.com"; L23: var WeixinDirectLoginClient = class { ... L60: if (!response.ok) throw new Error(`weixin_login_request_failed:${response.status}`); L61: const payload = await response.json(); L62: return payload.data ?? payload; ... L70: function defaultConfigPath() { L71: return join(homedir(), ".claude-codex-wechat", "config.json"); L72: } L73: function loadBridgeConfig(path = process.env.BRIDGE_CONFIG ?? defaultConfigPath()) { L74: if (!existsSync(path)) return normalizeBridgeConfig({}, process.env, path); ... L169: function isRetriableRenameError(error) {
Medium
Install Persistence

Source writes installer persistence such as shell profile or service configuration.

dist/server/cli.jsView on unpkg · L21
dist/web/assets/bootstrap-icons-mSm7cUeB.woff2View file
path = dist/web/assets/bootstrap-icons-mSm7cUeB.woff2 kind = high_entropy_blob sizeBytes = 134044 magicHex = [redacted]
High
Ships High Entropy Blob

Package ships high-entropy non-source blobs.

dist/web/assets/bootstrap-icons-mSm7cUeB.woff2View on unpkg

Findings

2 Critical4 High5 Medium6 Low
CriticalRemote Asset Decode Executedist/server/cli.js
CriticalTrigger Reachable Dangerous Capabilitydist/server/cli.js
HighChild Processdist/server/cli.js
HighShell
HighSpawned Bundled Service Listenerdist/server/cli.js
HighShips High Entropy Blobdist/web/assets/bootstrap-icons-mSm7cUeB.woff2
MediumNetwork
MediumEnvironment Vars
MediumInstall Persistencedist/server/cli.js
MediumStructural Risk Force Deep Review
MediumWildcard Dependency
LowNon Install Lifecycle Scripts
LowScripts Present
LowFilesystem
LowHigh Entropy Strings
LowUrl Strings
LowNo License