T09 · Insecure Skill Coding Practices
- Location
scripts/search.py:7- Finding
Plaintext HTTP Exposes Search Queries and Streamed Responses to Network Interception
- Content
View full analysis
Vulnerability Details
File Location:
scripts/search.py, lines 7–17
Vulnerability Type: Cleartext transmission of potentially sensitive data
Risk Level: MediumVulnerable Code
python def baidu_search(query:str) -> Generator[str, None, None]: url = "http://10.222.21.157:6600/api/Agent/queryanswerstream" headers = { "accept": "application/json", "Content-Type": "application/json-patch+json" } data = { "Query": query, "IsReasoner": False } try: response = requests.post(url, json=data, headers=headers, stream=True)Technical Analysis
The script sends the user-supplied query to a hardcoded private-network endpoint over plaintext HTTP. HTTP provides neither transport confidentiality nor cryptographic server authentication. Any party able to observe or manipulate traffic between the host and
10.222.21.157:6600may read the submitted query, modify the request, impersonate the service, or alter the streamed response.Although the documented use case concerns financial-report searches, users may include confidential company names, investment research, internal financial questions, or other sensitive context in a query. The service response is also delivered without transport integrity protection and is printed directly to the terminal.
Attack Path
- An attacker gains a network-adjacent position, such as access to the same local network, a compromised router or proxy, or control of a relevant network path.
- A user invokes the skill with a query.
- The script submits the query in an unencrypted HTTP request to the hardcoded endpoint.
- The attacker captures the request and reads its JSON
Queryvalue. - The attacker may additionally redirect, impersonate, or modify the HTTP exchange and inject attacker-controlled text into the streamed response.
- The script prints the manipulated response as though it ca ...[truncated 530 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace the plaintext endpoint with an authenticated HTTPS endpoint, for example
https://.../api/Agent/queryanswerstream. - Configure the server with a certificate issued by a trusted internal or public certificate authority, and retain TLS certificate verification in
requests. - Do not disable certificate validation through
verify=False. If an internal certificate authority is required, provide its CA bundle explicitly. - Consider mutual TLS or authenticated request signing when the endpoint is restricted to trusted internal clients.
- Move the endpoint into validated configuration rather than embedding a fixed address in source code. Permit only approved HTTPS origins.
- Apply network access controls so only authorized clients can reach the service.
- Avoid placing secrets or unnecessary confidential context in queries, and document what data is transmitted to the remote service.
- Add explicit connection and read timeouts while updating the request, such as a bounded
timeoutconfiguration, to prevent indefinite hangs.
- Replace the plaintext endpoint with an authenticated HTTPS endpoint, for example
