T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:29
- Finding
- BrowserAct API Key Solicited Through Insecure Chat Channel< to get your Key." ``` `scripts/amazon_asin_lookup_api.py:102-106`: ```python if not api_key: print("\n[!] ERROR: BrowserAct API Key is missing.", flush=True) print("Please follow these steps:", flush=True) print("1. Go to: https://www.browseract.com/reception/integrations", flush=True) print("2. Copy your API Key.", flush=True) print("3. Set it as an environment variable (BROWSERACT_API_KEY) or provide it in the chat.", flush=True) ``` ### Technical Analysis The Skill explicitly directs the agent to ask the user for a BrowserAct API key and tells the user that the credential may be provided in chat. API keys are authentication secrets and should not be transmitted through conversational interfaces. A key entered into chat may become available to conversation history, application logs, model context, monitoring systems, third-party integrations, or other components that process agent messages. This exceeds the minimum privilege and data exposure necessary for the declared Amazon ASIN lookup functionality because the implementation already supports retrieving the credential from the `BROWSERACT_API_KEY` environment variable. The script sends the credential as a Bearer token only to the documented HTTPS BrowserAct endpoint. That network transmission is consistent with the declared functionality. The vulnerability is the unnecessary solicitation ...[truncated 1619 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove every instruction suggesting that users provide API keys in chat. 2. Change `SKILL.md` so the agent stops execution and instructs the user to configure `BROWSERACT_API_KEY` outside the conversation. 3. Replace the vulnerable script message with wording such as: ```python print( "3. Configure BROWSERACT_API_KEY locally using a protected environment " "configuration or secret manager. Do not paste the key into chat.", flush=True, ) ``` 4. Prefer a platform-provided secret manager or encrypted credential store over persistent plaintext shell configuration. 5. Ensure that the key is never printed, included in exceptions, returned in results, or written to logs. 6. If interactive entry is required, use a masked local prompt such as `getpass.getpass()` and avoid retaining the value after the process exits. 7. Document key rotation and revocation procedures for users who previously disclosed a key in chat. 8. Apply the least privileges available to BrowserAct credentials and use separate keys for development and production environments. ]]>
