T09 · Insecure Skill Coding Practices
- Location
scripts/fetch_icp-query.py:73- Finding
API Credential Exposure Through URL Query Parameters and Command-Line Arguments
- Content
View full analysis
scripts/.env python3 scripts/fetch_icp-query.py 你的APIKey www.baidu.com ``` ```bash python3 scripts/fetch_icp-query.py ``` ```http GET https://apis.tianapi.com/icp/index?key=YOUR_API_KEY&domain=www.baidu.com ``` ### Technical Analysis The script sends the TianAPI credential as the `key` URL query parameter. The request uses HTTPS, so the key is encrypted while traversing the network. However, TLS does not prevent the complete URL from being captured by components that terminate or observe the request locally or at the service boundary, including application logs, reverse proxies, API gateways, monitoring systems, browser or diagnostic history, and exception telemetry. The network transmission itself is necessary for the declared ICP-query functionality and is limited to the documented TianAPI endpoint. The security issue is the credential placement rather than the existence of the request. The documentation additionally encourages passing the key as a command-line argument. Command-line secrets can be retained in shell history and may be visible to local process-inspection facilities while the command is running. The suggested `.env` creation com ...[truncated 1625 chars]- Remediation
View remediation
