T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/mcp_client.py:970
- Finding
- Silent Automatic Retrieval and Installation of Remotely Controlled Executable Code<![CDATA[ ## Vulnerability Details **File Location**: `scripts/mcp_client.py:970-1019`, `scripts/mcp_client.py:1529-1532`; documented in `SKILL.md:139-151` and `references/automatic-updates-and-safety.md:3-7` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: High ### Vulnerable Code ```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_root, update_home=update_home, get_bytes=get_bytes, ) discovery = checked["discovery"] manifest, new_files = download_update(discovery, get_bytes= ...[truncated 3961 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Default automatic installation to disabled. Permit silent update checks, but require explicit informed approval before replacing files. 2. Display the current version, proposed version, release notes, source, and affected files before installation. 3. Sign discovery metadata and release manifests with an offline or separately protected signing key. 4. Embed or securely provision a pinned public verification key in the reviewed package. 5. Verify signatures before trusting version numbers, URLs, or SHA-256 values. Retain hashes for integrity validation after signature verification. 6. Consider a signed metadata framework with rollback and freeze-attack protections, such as TUF-style root, timestamp, snapshot, and targets metadata. 7. Require an explicit command such as `update --install <version>` for code replacement. 8. Preserve the existing path, archive, ownership, size, rollback, and redirect protections; they remain valuable defense-in-depth. 9. Clearly notify the user after any successful update and require a new review or session before loading changed Skill instructions. ]]>
