T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/google_news_api.py:105
- Finding
- API Key Disclosure Encouraged Through Chat## Vulnerability Details **File Location**: `scripts/google_news_api.py`, lines 105-110 **Vulnerability Type**: Sensitive credential exposure through insecure operational guidance **Risk Level**: Medium ### Vulnerable Code ```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) sys.exit(1) ``` ### Technical Analysis The script explicitly advises users that they may provide the BrowserAct API key in chat. This is unnecessary because the implementation only reads the credential from the `BROWSERACT_API_KEY` environment variable. Entering a credential into a conversation can expose it to chat history, telemetry, logs, agent context, support tooling, or other systems that process or retain conversation content. This violates least-exposure principles for secrets and exceeds what is necessary for the declared news-retrieval functionality. The legitimate transmission of the key as a Bearer token to the declared BrowserAct HTTPS endpoint is required by the Skill. The vulnerability is specifically the instruction to disclose that key through a separate, unnecessary communication channel. ### Attack Path 1. A user runs the script without setting `BROWSERACT_API_KEY`. 2. The script instructs the user to provide the API key in chat. 3. The user follows that instruction and pastes the secret into the conversation. 4. The credential is retained or processed in chat history, logs, telemetry, or agent context. 5. An unauthorized party with access to any of those records obtains the key. 6. The exposed key is reused to invoke BrowserAct APIs under the victim's account. ### Impact Assessmen ...[truncated 476 chars]
- Remediation
- ## Remediation Suggestions - Remove the phrase `or provide it in the chat`. - Require users to configure the key locally through `BROWSERACT_API_KEY` or an approved secret manager. - Explicitly warn users never to paste API keys into conversations, source files, command histories, or logs. - Where supported, use short-lived, narrowly scoped credentials and provide rotation and revocation instructions. - Ensure error messages never print the key or an authorization header. - Replace the affected message with guidance such as: ```python print( "Set BROWSERACT_API_KEY using a protected environment or secret manager. " "Do not paste API keys into chat.", flush=True, ) ```
