T09 · Insecure Skill Coding Practices
- Location
scripts/search.py:35- Finding
Unredacted Search Queries Written to Standard Output
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill performs Baidu web search as advertised, but it handles search queries and an API key in ways users should review before installing.
Install only if you are comfortable sending search terms to Baidu and storing a Baidu API key for this skill. Avoid searching for secrets, personal data, or confidential internal information, and protect ~/.openclaw/openclaw.json with restrictive permissions if you follow the documented setup.
scripts/search.py:35Unredacted Search Queries Written to Standard Output
references/apikey-fetch.md:17API Key Stored in a Plaintext Configuration File Without Permission Hardening
The skill invokes code with both network access and an API key dependency, but it does not declare any explicit tool scope or permissions boundary in the skill metadata. This creates a transparency and governance gap: an agent or user cannot easily determine or constrain what capabilities the skill may exercise, increasing the chance of unintended external requests or secret exposure through overly broad execution context.
The skill says it performs web search via Baidu, but it does not clearly warn users that submitted queries are transmitted to Baidu's external API. Users may enter sensitive internal data, credentials, or proprietary research terms under the assumption of local processing, causing inadvertent third-party disclosure.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
Visit: **https://console.bce.baidu.com/ai-search/qianfan/ais/console/apiKey**
- Log in to your Baidu Cloud account
- Create an application or view existing API keys
- Copy your **API Key** (only API Key is needed)
### 2. Configure OpenClaw
The guide explicitly instructs users to place a live API key in plaintext within a local JSON file and does not mention file permission hardening, secret stores, or other secure handling practices. While this is common in developer tooling, it increases the chance of credential disclosure through backups, filesystem compromise, screenshots, shell history, or accidental inclusion in version control.
This code performs an outbound HTTP POST to a third-party service with user-controlled content. In the context of a web-search skill this is core functionality, but it still creates a genuine external transmission risk because entered queries leave the local trust boundary and may be stored or processed by the provider.
}
# 使用POST方法发送JSON数据
response = requests.post(url, json=requestBody, headers=headers)
response.raise_for_status()
results = response.json()
if "code" in results:
The skill sends the user-supplied query content to Baidu's external web search API, which is an external data disclosure boundary. In a search skill this behavior is expected, but it is still a real privacy/security concern because users may place sensitive data in queries and the file contains no disclosure, consent, or minimization around that transmission.
The skill includes Chinese-only example queries and uses Chinese-language content throughout the examples, which can imply a fixed locale or language expectation. Because the file does not state that the skill is China-specific or explicitly allow other languages, this creates a mild natural-language locale policy concern.
The script logs the fully parsed request body to stdout, which can expose search terms and optional parameters in logs, terminal history, or orchestration systems. If users include sensitive information in queries, that data may be retained beyond the intended request path and become accessible to operators or other systems.