T09 · Insecure Skill Coding Practices
- Location
scripts/fetch_oil_price.py:81- Finding
API Credential Exposure Through Command-Line Arguments and URL Query Parameters
- Content
View full analysis
GET https://apis.tianapi.com/oilprice/index?key=YOUR_API_KEY&prov=Hubei ``` ### Technical Analysis The script places the TianAPI key in a URL query parameter. Although the endpoint uses HTTPS, which protects the request from ordinary network interception in transit, HTTPS does not prevent the complete URL from being recorded by client diagnostics, reverse proxies, API gateways, monitoring systems, server access logs, or exception-reporting infrastructure. The script also supports receiving the API key through `--key`. Command-line secrets can be retained in shell history and may be visible in process inspection facilities while the command is running. The documentation further encourages users to place the key directly in commands and URLs, increasing the likelihood of accidental disclosure through terminal history, screenshots, copied logs, or shared troubleshooting output. Sending an authentication credential to the declared TianAPI service is necessary for the Sk ...[truncated 1613 chars]- Remediation
View remediation
