T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/search.py:39
- Finding
- Sensitive Search Queries Exposed Through Unconditional Logging## Vulnerability Details **File Location**: `scripts/search.py`, line 39 **Vulnerability Type**: Sensitive data exposure through logging **Risk Level**: Medium **Vulnerable Code**: ```python print(f"success parse request body: {parse_data}") ``` ### Technical Analysis The script unconditionally writes the complete parsed request object to standard output. This object contains the user-supplied search query and may also contain other request parameters. Search queries can include confidential names, private URLs, internal project information, incident details, credentials accidentally included by a user, or other sensitive material. In an OpenClaw deployment, standard output may be displayed to other users, captured by a gateway, forwarded to centralized logging, or retained beyond the execution of the Skill. Logging the request contents is not necessary for the declared web-search functionality and therefore exceeds the minimum data exposure required to perform the task. The API key itself is not printed by this statement. ### Attack Path 1. An attacker persuades a user or Agent to perform a Baidu search containing confidential information. 2. The Skill parses the supplied JSON request. 3. Before executing the search, the Skill prints the complete request object to standard output. 4. OpenClaw, a gateway, shell redirection, or a logging service captures and retains the output. 5. An individual with access to those logs retrieves the sensitive query data. This issue does not directly provide code execution or elevated system privileges. Exploitation requires the ability to influence query content and subsequently access the generated output or logs. ### Impact Assessment The issue can disclose the full search query and associated request parameters within the scope of each Skill invocation. Exposure is limited to data supplied in the request object; no evidence shows that the statement exposes the `BAIDU_API_KEY` ...[truncated 332 chars]
- Remediation
- ## Remediation Suggestions Remove the unconditional logging statement: ```python # Do not print parse_data or the query. ``` If diagnostic output is required: 1. Place it behind an explicitly enabled debug setting that is disabled by default. 2. Log only a generic event such as `Request parsed successfully`. 3. Never include the query, authorization header, API key, or complete request body. 4. Configure OpenClaw and related logging systems to restrict log access and use short retention periods. 5. Review existing logs and securely delete retained query data where policy permits. 6. Add automated tests or linting rules that detect logging of request bodies, secrets, and sensitive environment variables.
