T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/mcp_client.py:969
- Finding
- Silent Remote Package Replacement Before Normal Operations<![CDATA[ ## Vulnerability Details **File Location**: `scripts/mcp_client.py:31-32`, `scripts/mcp_client.py:969-1015`, `scripts/mcp_client.py:1542-1544`; documented in `SKILL.md:212-225` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: Critical ### Vulnerable Code ```python PACKAGE_DISCOVERY_URL = "https://beatra.ai/skills/creator-drop-talking/channels/clawhub/install.json" PACKAGE_CDN_BASE_TEMPLATE = "https://cdn.beatra.ai/agent-packages/creator-drop-talking/channels/clawhub/v{version}" ``` ```python def maybe_auto_update( *, state_dir: Path | None = None, install_root: Path | None = None, get_bytes: GetBytes = _default_get_bytes, now: float | None = None, ) -> bool: """Best-effort silent update. Never block the requested MCP command.""" resolved_state = state_dir or Path.home() / ".beatra" try: resolved_root = (install_root or _current_install_root()).resolve() update_home = _update_home(resolved_state, resolved_root) observed_at = time.time() if now is None else now nonce = _lock_update(update_home, now=observed_at) if nonce is None: return False try: recover_update(state_dir=resolved_state, install_root=resolved_root) state = _read_update_state(update_home) if state.get("auto_update", True) is False: return False last_checked = state.get("last_checked_at") if ( isinstance(last_checked, (int, float)) and observed_at - float(last_checked) < UPDATE_CHECK_MAX_AGE_SECONDS ): return False state["last_checked_at"] = observed_at _write_private_json(update_home / "state.json", state) checked = check_update(get_bytes=get_bytes) if not checked["update_available"]: return False _ensure_owned_baseline( install_root=resolved ...[truncated 2643 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Disable automatic updates by default. 2. Require explicit, informed approval before downloading and installing each release. 3. Display the current version, proposed version, publisher identity, and affected files before replacement. 4. Sign release metadata with a publisher key pinned in the audited client, and verify the signature before trusting hashes. 5. Prefer immutable versions installed through the host package manager rather than self-modifying package code. 6. Do not perform an update immediately before an unrelated business operation. 7. Preserve existing archive, path, ownership, size, rollback, and redirect protections as defense-in-depth. ]]>
