T09 · Insecure Skill Coding Practices
Error
- Location
- lib/zentao_client.py:34
- Finding
- ZenTao credentials can be transmitted over plaintext HTTP<![CDATA[ ## Vulnerability Details **File Location**: `lib/zentao_client.py:34-39`; equivalent behavior in `lib/zentao_rest_client.py:25-31`; insecure HTTP examples in `SKILL.md:52-60`, `SKILL.md:312-320`, and `package.json:18` **Vulnerability Type**: Cleartext transmission of sensitive authentication information **Risk Level**: High ### Vulnerable Code ```python def get_token(self) -> Optional[str]: """REST API: Get Token""" try: url = f"{self.rest_api_base}/tokens" data = {'account': self.username, 'password': self.password} response = httpx.post(url, json=data, timeout=30) ``` The REST client contains the equivalent implementation: ```python def get_token(self) -> Optional[str]: """POST /tokens - Get Token""" url = f"{self.base_url}/tokens" data = {'account': self.username, 'password': self.password} try: response = httpx.post(url, json=data, timeout=30) ``` The documented configuration explicitly recommends an HTTP URL: ```markdown - **API URL:** http://<your-zentao-host>/ - **Username:** <your-username> - **Password:** <your-password> ``` ### Technical Analysis The endpoint is read from the credential configuration and used without validating its scheme. Both API clients submit the ZenTao username and password directly to the resulting `/tokens` endpoint. The legacy authentication implementation also submits the password to the configured endpoint. If the endpoint begins with `http://`, neither `httpx` nor `requests` provides transport encryption. The password, username, session identifiers, authentication token, API requests, and returned project-management data can consequently be observed or modified by any attacker able to intercept the connection. This behavior is directly encouraged by the examples in `SKILL.md` and `package.json`. Network communication is necessary for the declared ZenTao integration, but supporting plaintext credential transport without a warning or explicit opt-in ...[truncated 1430 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Require `https://` endpoints by default and reject `http://` before any credentials are transmitted. 2. If plaintext HTTP is required for isolated development environments, require a conspicuous and explicit opt-in such as `allow_insecure_http=True`; keep it disabled by default. 3. Replace all HTTP examples in `SKILL.md`, `package.json`, and CLI help text with HTTPS examples. 4. Validate endpoints with a URL parser and permit only the expected `http` or `https` schemes; reject embedded user information, fragments, and malformed URLs. 5. Preserve TLS certificate verification and document how users should configure a trusted internal certificate authority. 6. Recommend a dedicated ZenTao service account with only the permissions required for the intended operations. 7. Consider warning users before authenticating to a newly configured host, displaying only a sanitized hostname and scheme. ]]>
