T03 · Remote Payload Retrieval and Execution
- Location
scripts/mcp_client.py:969- Finding
Silent Automatic Updates Permit Remotely Controlled Code Replacement Without Independent Signature Verification
- Content
View full analysis
Vulnerability Details
File Location:
scripts/mcp_client.py:969-1018
Additional Locations:scripts/mcp_client.py:31-32,scripts/mcp_client.py:469-491,scripts/mcp_client.py:1543;SKILL.md:183-203;references/automatic-updates-and-safety.md:3-19
Vulnerability Type: Remote payload retrieval and execution
Risk Level: HighVulnerable 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 ...[truncated 3039 chars]- Remediation
View remediation
Remediation Suggestions
- Disable automatic code replacement by default and require explicit user approval before installing each update.
- Sign release metadata and packages with a private release key, and pin the corresponding public key in the audited client.
- Prefer a framework such as TUF with root metadata, threshold signatures, expiration, version rollback protection, and key rotation.
- Verify signatures before trusting any remotely supplied checksum or version.
- Separate update checking from update installation so ordinary business calls cannot implicitly modify executable files.
- Display the target version and verified publisher identity before installation.
- Preserve the existing archive-path, size, ownership, staging, rollback, and redirect protections as defense-in-depth.
