T09 · Insecure Skill Coding Practices
- Location
search.py:47- Finding
Sensitive Search Request Data Exposed in Standard Output
- Content
View full analysis
Vulnerability Details
File Location:
search.py, line 47
Vulnerability Type: Sensitive data exposure through diagnostic logging
Risk Level: MediumVulnerable Code
python print(f"success parse request body: {parse_data}")Technical Analysis
The script writes the complete parsed request object to standard output. This object can contain confidential search queries, private knowledge-base identifiers, and any additional caller-supplied fields. Standard output is commonly captured by agent runtimes, process supervisors, CI systems, and centralized logging services.
Logging the full request is unnecessary for the Skill's declared search functionality and creates a secondary disclosure channel outside the intended encrypted request to Baidu Qianfan. Although the
BAIDU_API_KEYis read separately from the environment and is not directly printed by this statement, secrets accidentally included in the input object would also be recorded.The flagged outbound network behavior itself is consistent with the declared functionality:
search.pysends the query and knowledge-base IDs to the documented HTTPS Baidu Qianfan search endpoint and supplies the required API key in an authorization header. No evidence of transmission to an undeclared destination was found.Attack Path
- A user or agent invokes the Skill with a confidential query, private knowledge-base IDs, or an accidentally embedded secret.
- The script parses the JSON argument into
parse_data. - Line 47 prints the entire object before making the API request.
- The surrounding runtime, process manager, or logging service captures standard output.
- An attacker or lower-privileged operator with access to those logs retrieves the disclosed information.
Exploitation requires access to captured process output or downstream logs; this code does not independently grant such access.
Impact Assessment
The issue can disclose priv ...[truncated 361 chars]
- Remediation
View remediation
Remediation Suggestions
Remove the diagnostic statement or replace it with a fixed message that does not include user-controlled data:
python print("Request body parsed successfully.")If detailed diagnostics are operationally necessary:
- Make verbose logging explicitly opt-in and disabled by default.
- Never log query text, authorization values, or complete request objects.
- Redact knowledge-base identifiers and any fields that may contain secrets.
- Restrict access to runtime logs and configure short retention periods.
- Review existing retained logs and securely delete copies containing sensitive request data.
- Prefer structured logging with an explicit allowlist of non-sensitive fields.
