T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:15
- Finding
- Access tokens and sensitive queries may be transmitted over plaintext HTTP<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:15-21`, `SKILL.md:107-124`, `scripts/ask.sh:15-16`, `scripts/search.sh:14-15` **Vulnerability Type**: Plaintext transmission of credentials and potentially sensitive user data **Risk Level**: High ### Vulnerable Code ```bash curl -X POST "http://{COGMATE_URL}/api/ask?token=YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{"question": "你的问题"}' ``` The documentation also provides an explicitly plaintext endpoint in its Python example: ```python COGMATE_URL = "http://example.com:8000" TOKEN = "your_token_here" response = requests.post( f"{COGMATE_URL}/api/ask", params={"token": TOKEN}, json={"question": "What are the key insights about X?"} ) ``` The helper scripts accept the URL without enforcing HTTPS: ```bash curl -s -X POST "${COGMATE_URL}/api/ask?token=${TOKEN}" \ -H "Content-Type: application/json" \ -d "{\"question\": \"${QUESTION}\"}" | \ python3 -c "import sys,json; r=json.load(sys.stdin); print(r.get('answer','No answer'))" ``` ```bash curl -s "${COGMATE_URL}/api/visual/facts?${PARAMS}" | \ python3 -c " ``` ### Technical Analysis Network communication is necessary for the Skill's declared Cogmate API-client functionality. However, transmitting reusable access tokens, questions, search terms, and API responses over unencrypted HTTP exceeds what is safely necessary. The documentation actively demonstrates plaintext HTTP, and the scripts do not validate the URL scheme. Consequently, TLS confidentiality, server authentication, and transport integrity are absent when a user follows the examples or supplies an HTTP endpoint. The transmitted questions and search terms may themselves contain private information. Responses may contain personal knowledge-base facts, creating bidirectional sensitive-data exposure. ### Attack Path 1. A victim follows the documented HTTP example or supplies an `http://` Cogmate URL to a helper script. 2. The script send ...[truncated 1014 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Require `https://` endpoints in both helper scripts and reject plaintext HTTP by default. 2. Validate the scheme before invoking `curl`, for example: ```bash case "$COGMATE_URL" in https://*) ;; *) echo "Error: Cogmate URL must use HTTPS." >&2; exit 1 ;; esac ``` 3. Replace all documented `http://` examples with HTTPS examples. 4. Do not add `curl -k` or otherwise disable certificate verification. 5. Where deployments need custom certificate authorities, support an explicit trusted CA file rather than bypassing TLS verification. 6. Consider an allowlist or explicit confirmation for unfamiliar hosts because the caller-selected endpoint receives both credentials and user data. 7. Clearly document that questions, searches, and returned knowledge may be sensitive and are transmitted to the configured Cogmate operator. ]]>
