T03 · Remote Payload Retrieval and Execution
- Location
- scripts/a2a_client.py:208
- Finding
- Unverified Remote Skill Content Is Retrieved and Intended for Installation<![CDATA[ ## Vulnerability Details **File Location**: `scripts/a2a_client.py:208-234`; related installation workflow at `SKILL.md:280-291` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: Critical ### Vulnerable Code ```python # Step 1: Request content, expect 402 response = requests.get(f"{self.api_url}/v1/listings/{skill_id}/content") if response.status_code != 402: if response.status_code == 200: # Already purchased or free return response.json() response.raise_for_status() # Step 2: Parse payment requirements payment_info = json.loads(response.headers.get("X-Payment-Required", "{}")) # Step 3: Sign payment (simplified - real implementation uses ERC-3009) payment_proof = self._sign_payment(payment_info, price) # Step 4: Retry with payment proof headers = self._sign_request("POST", f"/v1/listings/{skill_id}/content") headers["X-Payment"] = payment_proof headers["Content-Type"] = "application/json" response = requests.post( f"{self.api_url}/v1/listings/{skill_id}/content", headers=headers ) response.raise_for_status() # Update daily spent self.daily_spent += price return response.json() ``` The documented workflow subsequently directs the agent to install the result: ```text 5. Complete x402 payment flow 6. Install acquired skill 7. Confirm: "Purchased PDF Parser Pro for $5. Ready to use." ``` ### Technical Analysis The client retrieves mutable skill packages from an external marketplace and returns their instructions and files without verifying a publisher signature, immutable digest, trusted manifest, file allowlist, or expected package identity. The declared workflow then installs the acquired package. The remotely supplied content is controlled by marketplace sellers and can differ from anything reviewed with this project. Seller reputation and marketplace metadata are not substitutes for cryptographic integrity or package safety validation. A marketplace compromise could likewise r ...[truncated 1175 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Require every package to include a publisher signature over an immutable manifest and content digest. 2. Verify the signature, publisher identity, package digest, listing ID, and package version locally before extraction or installation. 3. Pin the expected digest at purchase time so the marketplace cannot substitute content afterward. 4. Reject path traversal, symlinks, executable binaries, lifecycle hooks, and undeclared files during extraction. 5. Perform static scanning of scripts and instruction text before activation. 6. Display requested permissions and require explicit human approval before installing third-party content. 7. Install packages in an isolated directory and execute them in a sandbox with minimal filesystem, process, network, secret, and wallet access. 8. Maintain an auditable package receipt containing the seller, version, digest, signature, and approval record. ]]>
