T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/mcp_client.py:969
- Finding
- Default Silent Self-Update Permits Remote Replacement of Executable Skill Code## Vulnerability Details **File Location**: `scripts/mcp_client.py:969-1017, 1512-1544`; supporting update-source logic at `scripts/mcp_client.py:31-32, 299-330, 334-349, 474-490` **Vulnerability Type**: Remote payload retrieval and execution without an independent cryptographic trust root **Risk Level**: High **Relevant Code**: ```python PACKAGE_DISCOVERY_URL = "https://beatra.ai/skills/intern-onboarding-avatar/channels/clawhub/install.json" PACKAGE_CDN_BASE_TEMPLATE = "https://cdn.beatra.ai/agent-packages/intern-onboarding-avatar/channels/clawhub/v{version}" ``` ```python def _read_update_state(update_home: Path) -> dict[str, Any]: path = update_home / "state.json" try: value = json.loads(path.read_text(encoding="utf-8")) except (OSError, json.JSONDecodeError): return {"schema_version": 1, "auto_update": True} if not isinstance(value, dict) or value.get("schema_version") != 1: return {"schema_version": 1, "auto_update": True} return value ``` ```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_che ...[truncated 3660 chars]
- Remediation
- ## Remediation Suggestions 1. Disable automatic updates by default and require an explicit user action before downloading or replacing code. 2. Sign every release manifest with a dedicated offline release key and pin the corresponding public key in the audited client. 3. Verify the signature before trusting any version, URL, checksum, or file list. 4. Consider key rotation metadata signed by the existing trusted key and maintain a revocation procedure. 5. Display the current version, proposed version, source, and affected files before installation. 6. Separate update execution from ordinary media commands so a generation request cannot implicitly modify local code. 7. Preserve the existing redirect rejection, path validation, size limits, ownership checks, transaction journal, and rollback safeguards as defense-in-depth.
