T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:25
- Finding
- BrowserAct API Key May Be Disclosed Through Agent Conversations< to get your Key first." ``` `scripts/google_image_api.py:89-96`: ```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. Provide it to me or set it as an environment variable (BROWSERACT_API_KEY).", flush=True) sys.exit(1) ``` ### Technical Analysis The implementation correctly supports loading the BrowserAct credential from the `BROWSERACT_API_KEY` environment variable. However, the Skill documentation directs the Agent to wait for the user to provide the key, while the script explicitly tells the user to “Provide it to me.” This guidance can cause users to paste a bearer credential into an Agent conversation. Such credentials may then be retained in conversation history, execution traces, monitoring systems, support exports, or other logs accessible to parties that do not need the secret. Conversational disclosure is not required for the declared Google Images extraction functionality. The script can obtain the credential exclusively from an environment variable or secret manager. Therefore, soliciting it through the Agent exceed ...[truncated 1792 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove all instructions that ask users to provide API keys to the Agent or paste them into a conversation. 2. Change the documentation to require local configuration through an environment variable or supported secret manager. 3. Replace the script message with guidance such as: ```python print( "Set BROWSERACT_API_KEY in your local environment or approved secret manager. " "Do not paste the key into chat or command-line arguments.", flush=True, ) ``` 4. Continue reading the credential only through `os.getenv("BROWSERACT_API_KEY")`; do not add command-line credential support because command lines may be recorded in shell history and process listings. 5. Ensure exceptions, request diagnostics, and debug logs never include authorization headers. 6. Recommend immediate revocation and rotation when a user has already pasted a key into a conversation. 7. Where supported, use scoped API credentials with minimum permissions, quota limits, expiration, and usage alerts. 8. Document that the key is sent only to `https://api.browseract.com` for the declared API operation. ]]>
