T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:27
- Finding
- Unsafe API Credential Disclosure Guidance<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:27-30`; related implementation in `scripts/deep_website_scraper_api.py:92-98` **Vulnerability Type**: Sensitive credential exposure through insecure onboarding instructions **Risk Level**: Medium ### Complete Code Snippets `SKILL.md:27-30`: ```markdown ## API Key Guide Before running, check the `BROWSERACT_API_KEY` environment variable. If it is not set, do not take other measures; ask and wait for the user to provide it. Agent must tell the user: ``` `scripts/deep_website_scraper_api.py:92-98`: ```python api_key = os.getenv("BROWSERACT_API_KEY") if not api_key: print("\n[!] ERROR: BrowserAct API Key is missing.", flush=True) print("Please follow these steps:", flush=True) print(f"1. Go to: {API_KEY_URL}", 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 documentation instructs the Agent to ask the user for the BrowserAct API key, while the script tells the user to “Provide it to me.” This encourages disclosure of a bearer credential through the Agent conversation rather than limiting credential handling to a local environment variable. Conversation messages may be retained in transcripts, observability systems, debugging logs, or other infrastructure outside the execution environment. Requesting the secret through chat is unnecessary because the script already supports reading it securely from `BROWSERACT_API_KEY`. The script does not print the value after reading it, and its use as a bearer token for the declared BrowserAct API is functionally necessary. The vulnerability is specifically the insecure onboarding and disclosure guidance, not the environment-variable lookup itself. ### Attack Path 1. The user attempts to run the Skill without setting `BROWSERACT_API_KEY`. 2. The documentation or script directs th ...[truncated 781 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove all instructions asking the user to provide the API key to the Agent. 2. Change the script message to require local configuration only, for example: ```python print( "Set BROWSERACT_API_KEY securely in the local execution environment. " "Do not paste the key into chat.", flush=True, ) ``` 3. Update `SKILL.md` to explicitly prohibit requesting, displaying, echoing, logging, or storing the key. 4. Continue reading the credential from `BROWSERACT_API_KEY`, but validate only that it is present; do not include its value in exceptions or diagnostic output. 5. Recommend secret-manager or scoped runtime injection where available. 6. Advise users to rotate any API key previously disclosed through a conversation or log. 7. Use a minimally scoped BrowserAct credential where the provider supports scope or quota restrictions. ]]>
