T09 · Insecure Skill Coding Practices
- Location
scripts/appflowy_client.py:64- Finding
Credentials and Bearer Tokens May Be Transmitted Over Plaintext HTTP
- Content
View full analysis
Dict[str, str]: headers = { "client-version": self.client_version, "client-timestamp": str(now_millis()), "device-id": self.device_id, } if token: headers["Authorization"] = f"Bearer {token}" return headers ``` ```python def login_password(self, email: str, password: str) -> Dict[str, Any]: base = self._require_gotrue_url() url = f"{base}/token" return self._request_json( "POST", url, params={"grant_type": "password"}, json_body={"email": email, "password": password}, token=None, ) ``` The distributed example configuration explicitly selects plaintext HTTP: ```json { "base_url": "http://10.60.0.189", "gotrue_url": "http://10.60.0.189/gotrue" } ``` ### Technical Analysis The client accepts arbitrary URL schemes without requiring TLS. It then sends account credentials in a JSON request body and bearer tokens in the `Authorization` header to those endpoints. The project documentation and example configuration encourage use of `http://`, making this m ...[truncated 1932 chars]- Remediation
View remediation
str: parsed = urlparse(url) if parsed.scheme != "https": if not allow_insecure_http: raise AppFlowyError( "HTTPS is required for endpoints carrying credentials or tokens." ) return url.rstrip("/") ``` ]]>
