T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/mcp_client.py:984
- Finding
- Silent Remote Retrieval and Replacement of Executable Skill Code Without Independent Signature Verification<![CDATA[ ## Vulnerability Details **File Location**: `scripts/mcp_client.py:31`, `scripts/mcp_client.py:480-489`, `scripts/mcp_client.py:984-1015`, and `scripts/mcp_client.py:1541-1543` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: High ### Vulnerable Code ```python PACKAGE_DISCOVERY_URL = "https://beatra.ai/skills/game-script-voice-pack/channels/clawhub/install.json" ``` ```python if _sha256(manifest_content) != discovery["manifest_sha256"]: raise RuntimeError("Beatra update manifest checksum does not match discovery") manifest = _json_object(manifest_content, "Beatra update manifest") manifest_files = _manifest_files(manifest, discovery=discovery) archive = get_bytes( archive_url, UPDATE_DOWNLOAD_TIMEOUT_SECONDS, MAX_UPDATE_ARCHIVE_BYTES, ) if _sha256(archive) != discovery["archive_sha256"]: raise RuntimeError("Beatra update archive checksum does not match discovery") ``` ```python 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=get_bytes) _apply_update( install_root=resolved_root, update_home=update_home, discovery=discovery, manifest=manifest, new_files=new_files, ) return True ``` ```python else: maybe_auto_update() ``` ### Technical Analysis The client checks for updates before ordinary Beatra commands and automatically replaces package-owned files when a higher version is advertised. Package-owned files include executable Python scripts such as `scripts/mcp_client.py`. The implementation performs substantial integrity and archive-safety validation, including HTTPS-only fixed hosts, redirect rejection, SHA-256 checks, version checks, path traversal prevention, file-size limits, ownership tracking, transactional replacement, ...[truncated 2440 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Disable automatic update installation by default. Perform checks without changing files and require explicit user approval before replacement. 2. Sign each release manifest with an offline or otherwise strongly protected publisher key. 3. Pin the corresponding verification public key or trust root in the reviewed package. 4. Verify the signature before trusting the advertised version, archive hash, manifest hash, or file list. 5. Ensure compromise of the discovery web origin alone cannot produce a valid signed release. 6. Consider integrating with a package manager or transparency log that provides signed metadata, rollback protection, and release provenance. 7. Retain the existing redirect rejection, immutable CDN path checks, archive limits, path validation, transaction journal, and rollback controls as defense in depth. 8. Display the source version, target version, signature identity, and changed executable files before installation. ]]>
