T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:25
- Finding
- API Credential Solicitation Through the Conversational Interface< to get your Key." ``` `scripts/google_maps_reviews_api.py:91-98`: ```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 Skill explicitly instructs the Agent to ask the user for a BrowserAct API key and the script tells the user to “Provide it to me.” This encourages disclosure of a reusable credential through the conversational interface. The script itself only reads the credential from `BROWSERACT_API_KEY` and uses it as a Bearer token for the declared BrowserAct service: ```python headers = {"Authorization": f"Bearer {api_key}"} ``` Consequently, transmitting the key through chat is not technically necessary. The least-privilege approach is for the user to configure the credential directly in a protected local environment or secret manager without exposing its value to the Agent, conversation transcript, or surrounding logging infrastructure. The network requests to `https://api.browseract.com/v2/workflow` are consistent with the declar ...[truncated 2084 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the instruction to ask the user to provide the API key through the conversation. 2. Replace it with guidance requiring local secret configuration, for example: ```markdown If `BROWSERACT_API_KEY` is not configured, stop and instruct the user to set it through the runtime's protected secret manager or local environment. Never ask the user to paste the key into chat. ``` 3. Change the script’s missing-key message so it does not offer disclosure to the Agent: ```python if not api_key: print( "ERROR: BROWSERACT_API_KEY is not configured. " "Set it using your runtime's protected secret manager or environment configuration. " "Do not paste the key into chat or command-line arguments.", flush=True, ) sys.exit(1) ``` 4. Prefer a platform-provided secret store over plaintext shell configuration where available, and restrict secret access to this Skill’s process. 5. Ensure logs, exception messages, telemetry, and task output never print the `Authorization` header or API-key value. 6. Rotate the BrowserAct key if it has previously been disclosed through a conversation or other logged channel. 7. Apply the narrowest BrowserAct permissions, spending limits, and expiration supported by the service. 8. Separately harden the expected network operations with connection/read timeouts and a maximum polling duration to avoid indefinite execution. ]]>
