T09 · Insecure Skill Coding Practices
- Location
scripts/search.py:38- Finding
Sensitive Search Query Exposed Through Standard Output Logging
- Content
View full analysis
Vulnerability Details
File Location:
scripts/search.py, lines 38–44
Vulnerability Type: Sensitive data exposure through application logging
Risk Level: LowVulnerable Code
python query = sys.argv[1] parse_data = {} try: parse_data = json.loads(query) print(f"success parse request body: {parse_data}") except json.JSONDecodeError as e: print(f"JSON parse error: {e}")Technical Analysis
The script writes the complete parsed request object to standard output. This object includes the user-supplied search query and may include other request parameters.
Search queries can contain personal information, confidential project names, internal infrastructure details, credentials entered accidentally, or other sensitive material. Standard output may be retained by OpenClaw, gateway services, container runtimes, CI systems, terminal history capture, or centralized logging infrastructure.
Logging the full request is not required for the declared web-search functionality and therefore creates an avoidable secondary disclosure channel. The API key is not included in this log statement.
Attack Path
- A user or agent invokes the Skill with a query containing sensitive information.
- The script parses the request JSON.
- The complete parsed request, including the query, is printed to standard output.
- The execution environment captures or persists standard output.
- A user or service with access to those logs can recover the sensitive query.
This issue does not directly grant system privileges or code execution. Exploitation requires access to the relevant execution logs or output stream.
Impact Assessment
The primary impact is loss of confidentiality for search queries. Exposure is limited to information supplied in the request object and does not, based on the reviewed code, include the
BAIDU_API_KEY.The practical scope depends on the surrounding logging ...[truncated 161 chars]
- Remediation
View remediation
Remediation Suggestions
Remove the full-request logging statement:
python parse_data = json.loads(query)If diagnostic logging is necessary:
- Require an explicit debug option that is disabled by default.
- Log only non-sensitive metadata, such as whether parsing succeeded.
- Do not log query text, authorization headers, API keys, or complete request bodies.
- Apply structured redaction before logging any user-controlled object.
- Configure production logs with appropriate access controls and retention limits.
A safer implementation is:
python try: parse_data = json.loads(query) except json.JSONDecodeError as e: print(f"JSON parse error: {e}") sys.exit(1)
