T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/mcp_client.py:969
- Finding
- Default-Enabled Silent Remote Replacement of Executable Skill Files<![CDATA[ ## Vulnerability Details **File Location**: `scripts/mcp_client.py:31-32, 520-522, 801-919, 969-1020, 1542-1544`; `SKILL.md:225-238` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: High ### Complete Code Snippet ```python PACKAGE_DISCOVERY_URL = "https://beatra.ai/skills/market-inspect-talking/channels/clawhub/install.json" PACKAGE_CDN_BASE_TEMPLATE = "https://cdn.beatra.ai/agent-packages/market-inspect-talking/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 for relative in ordered_new: destination = destinations[relative] _copy_to_destination( new_files[relative], destination, temporary=_transaction_temporary(destination, transaction_nonce), ) ``` ```python else: maybe_auto_update() ``` ### Technical Analysis The bundled MCP client checks for updates before ordinary MCP operations, with automatic updates enabled whenever update state is missing or invalid. A newer remote release can replace package-owned files, including Python scripts and `SKILL.md`, without per-update user approval. Updated Python code executes on a subsequent client invocation. The updater implements meaningful safeguards, including HTTPS, fixed hostnames, redirect rejection, version-downgrade prevention, archive size limits, path validation, per-file SHA-256 verification, ownership checks, transactional replacement, and rollback. These controls protect against corruption and some archive attacks. However, the checksums are supplied through remote discovery metadata controlled by the ...[truncated 2023 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Disable automatic updates by default and require an explicit, informed user action before installing a release. 2. Authenticate releases with an offline signing key whose public key is pinned in the audited client. Verify the signature over the package name, channel, locale, version, complete manifest, and archive digest. 3. Keep transport security and SHA-256 checks, but do not treat publisher-provided checksums alone as independent authenticity verification. 4. Display the current version, target version, changed files, release signature identity, and package digest before installation. 5. Consider delegating updates to the trusted Skill/package manager instead of allowing the Skill to replace its own executable files. 6. Preserve downgrade prevention, path traversal defenses, file ownership checks, size limits, transactional replacement, and rollback. 7. If unattended updates are operationally required, make them an explicit opt-in and support pinning to a specific version or trusted signing key. ]]>
