T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:34
- Finding
- API Credentials Exposed Through URL Query Parameters<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:34-67`; `references/api-docs.md:16-18` **Vulnerability Type**: API key exposure through URL query strings **Risk Level**: Medium ### Vulnerable Code Snippets `SKILL.md:34` ```markdown Auth: `?api_key=KEY` or header `X-API-Key: KEY` ``` `SKILL.md:39-45` ```bash curl -s "https://api.agentweb.live/v1/search?q=thai+restaurant&lat=55.67&lng=12.56&radius_km=5&limit=10&api_key=KEY" ``` ```bash curl -s "https://api.agentweb.live/v1/business/UUID?api_key=KEY" ``` `SKILL.md:50-67` ```bash curl -s -X POST "https://api.agentweb.live/v1/contribute?api_key=KEY" \ -H 'Content-Type: application/json' \ -d '{"name": "Business Name", "phone": "+45 12345678", "category": "restaurant", "country_code": "DK"}' ``` ```bash curl -s -X POST "https://api.agentweb.live/v1/report?api_key=KEY" \ -H 'Content-Type: application/json' \ -d '{"business_id": "UUID", "report_type": "closed", "details": "Permanently closed"}' ``` `references/api-docs.md:16-18` ```markdown ### Auth methods (use any one) - Header: `X-API-Key: aw_live_...` - Header: `Authorization: Bearer aw_live_...` - Query param: `?api_key=aw_live_...` ``` ### Technical Analysis The skill supports secure header-based authentication, but its primary command examples place the API key directly in the request URL. Credentials embedded in URLs can be exposed through: - Shell command history - Process listings while `curl` is running - HTTP client, reverse-proxy, CDN, and server access logs - Monitoring, tracing, telemetry, and diagnostic systems - Copied URLs, terminal recordings, and error reports Unlike authorization headers, URLs are routinely retained and propagated by infrastructure. The use of HTTPS protects the URL in transit from passive network observers, but it does not prevent disclosure through endpoints, local process inspection, or logging infrastructure. ### Attack Path 1. A user supplies an AgentWeb API key or configures `AGENTWEB_A ...[truncated 1114 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove query-string authentication from all examples and recommended workflows. 2. Send the key exclusively in an authentication header: ```bash curl -s "https://api.agentweb.live/v1/search?q=thai+restaurant&lat=55.67&lng=12.56&radius_km=5&limit=10" \ -H "X-API-Key: ${AGENTWEB_API_KEY}" ``` 3. Apply the same header-based pattern to the business-details, contribution, and report endpoints. 4. Avoid placing secrets directly in command text. Read the key from `AGENTWEB_API_KEY` and ensure scripts do not enable command tracing such as `set -x`. 5. Update `references/api-docs.md` to discourage or remove `?api_key=` authentication. 6. Ensure API gateways, proxies, and application logs redact credentials if backward compatibility requires temporary support for query authentication. 7. Rotate any key suspected of having appeared in command history, process telemetry, logs, copied URLs, or diagnostic reports. 8. Consider rejecting query-string credentials server-side after a documented migration period. ]]>
