T09 · Insecure Skill Coding Practices
- Location
- references/sdk-usage.md:7
- Finding
- External Transmission of Potentially Sensitive Source Code Without Data-Safety Controls## Vulnerability Details **File Location**: `references/sdk-usage.md:7-19` **Vulnerability Type**: Sensitive information transmitted to an external service **Risk Level**: Medium ### Vulnerable Code ```python import requests # Step 1: Call without payment to discover requirements r = requests.post('https://agent-bazaar.com/api/x402/code-review', json={'code': 'print("hello")', 'language': 'python'}) if r.status_code == 402: payment_intent = r.json()['payment'] # Step 2: Delegate payment to lobster.cash wallet # lobster.cash handles: amount, currency, signing, broadcast # Step 3: Retry with payment proof from lobster.cash r = requests.post('https://agent-bazaar.com/api/x402/code-review', json={'code': 'print("hello")', 'language': 'python'}, headers={'X-402-Payment': payment_proof}) ``` ### Technical Analysis The documented integration transmits source code to `https://agent-bazaar.com`. Sending task data to this service is necessary for its remote code-review functionality, but the instructions do not establish safeguards to ensure that only the minimum required data is transmitted. In particular, the workflow does not require: - Explicit user approval before disclosing content to the external service. - Secret scanning or removal of credentials embedded in source files. - Exclusion of private keys, environment files, internal URLs, personal data, or proprietary material. - Disclosure of the service's data-retention and processing terms. - Selection of only the files or code fragments necessary for the requested analysis. The retry after payment sends the source code a second time. Other documented endpoints similarly accept arbitrary text, URLs, project descriptions, smart contracts, and portfolio information, so the disclosure risk is not limited to the code-review example. ### Attack Path 1. A user asks the agent to review a local or proprietary projec ...[truncated 1143 chars]
- Remediation
- ## Remediation Suggestions 1. Require explicit user authorization before sending any local content to `agent-bazaar.com`. 2. Display the destination, endpoint, selected files, data categories, and estimated cost before transmission. 3. Scan submitted content for secrets, private keys, access tokens, passwords, personal data, and internal endpoints. 4. Redact detected sensitive values and require separate confirmation if safe redaction is impossible. 5. Use an allowlist-based file selection process and exclude `.env` files, key stores, credential files, build artifacts, dependency directories, and version-control metadata by default. 6. Send only the smallest relevant code fragment rather than an entire repository. 7. Document the external service's privacy, retention, training, deletion, and subprocessors policies. 8. Warn users that demo mode still transmits task data unless the service explicitly guarantees otherwise. 9. Avoid duplicate submission when possible, or use a payment-discovery request that contains no sensitive task content.
