T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/mcp_client.py:899
- Finding
- Silent Self-Update Can Retrieve and Install Remotely Controlled Code Without Independent Signature Verification<![CDATA[ ## Vulnerability Details **File Location**: `scripts/mcp_client.py:31-32, 296-359, 469-490, 899-950, 1527-1529`; `SKILL.md:180-200`; `references/automatic-updates-and-safety.md:3-19` **Vulnerability Type**: Remote payload retrieval and execution through an insufficiently authenticated update channel **Risk Level**: High ### Vulnerable Code ```python PACKAGE_DISCOVERY_URL = "https://beatra.ai/skills/class-duty-voice/channels/clawhub/install.json" PACKAGE_CDN_BASE_TEMPLATE = ( "https://cdn.beatra.ai/agent-packages/" "class-duty-voice/channels/clawhub/v{version}" ) ``` ```python def check_update( *, get_bytes: GetBytes = _default_get_bytes, ) -> dict[str, Any]: discovery = _json_object( get_bytes( _discovery_url(), UPDATE_DISCOVERY_TIMEOUT_SECONDS, MAX_UPDATE_DISCOVERY_BYTES, ), "Beatra update discovery", ) current = _semver(PACKAGE_VERSION) available = _semver(discovery.get("version")) _release_urls(discovery) if available < current: raise RuntimeError("Beatra update discovery attempted a version downgrade") return { "current_version": PACKAGE_VERSION, "available_version": discovery["version"], "update_available": available > current, "discovery": discovery, } ``` ```python def download_update( discovery: dict[str, Any], *, get_bytes: GetBytes = _default_get_bytes, ) -> tuple[dict[str, Any], dict[str, bytes]]: archive_url, manifest_url = _release_urls(discovery) manifest_content = get_bytes( manifest_url, UPDATE_DOWNLOAD_TIMEOUT_SECONDS, MAX_UPDATE_MANIFEST_BYTES, ) 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) ...[truncated 4822 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Sign release metadata with a dedicated offline-controlled signing key. 2. Embed or securely provision the corresponding public key in the audited client. 3. Verify a signature covering package identity, version, channel, locale, expiry, manifest digest, and archive digest. 4. Treat TLS and SHA-256 checks as transport and integrity controls, not as sufficient publisher authentication. 5. Disable automatic installation by default. Notify the user and obtain explicit approval before replacing executable files. 6. Separate update operations from credential-bearing business commands. 7. Support key rotation through a signed root-metadata mechanism rather than mutable remote configuration. 8. Record the verified signer and release digest in local update state for auditability. ]]>
