T09 · Insecure Skill Coding Practices
- Location
env-example.txt:1- Finding
Site-Administrator Token and Knowledge-Base Data Transmitted over Plain HTTP
- Content
View full analysis
dict: return {"Authorization": f"token {ADMIN_TOKEN}", "Content-Type": "application/json"} def api(method: str, path: str, *, json_body: dict | None = None, params: dict | None = None, ok: tuple[int, ...] = (200, 201, 204)): if not GITEA_URL: raise GiteaError("GITEA_URL is not configured") resp = requests.request( method, f"{GITEA_URL}/api/v1{path}", headers=headers(), json=json_body, params=params, timeout=30, ) ``` ### Technical Analysis The example environment installs a hard-coded bare-IP URL using unencrypted HTTP. The setup script copies this configuration into `.env` by default, and the API client attaches `GITEA_ADMIN_TOKEN` to every request as an Authorization header. HTTP provides neither confidentiality nor server authentication. Any network observer or active man-in-the-middle can capture the administrator token, inspect private knowledge-base content, or alter API responses and uploaded data. A timeout does not mitigate transport interception, and TLS certificate validation cannot occur because the configured protocol is HTTP. The token is explicitly named and used as an administrator credential. The same client contains administrative operations such as repository creation for a ...[truncated 1191 chars]- Remediation
View remediation
