T09 · Insecure Skill Coding Practices
- Location
env-example.txt:1- Finding
Site-administrator token and private repository content transmitted over plaintext 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 configures Gitea through plaintext HTTP at an external bare IP address. The setup script automatically copies this value into `.env`, and the API client sends `GITEA_ADMIN_TOKEN` in the `Authorization` header on every request. HTTP provides no confidentiality or server authentication. A network-positioned attacker can observe the authorization header and request or response bodies. This includes private knowledge-base documents read from Gitea and evaluations, catalogs, and indexes written back to it. The API client performs no scheme validation that would reject `http://` endpoints. ### Attack Path 1. An operator runs `setup.sh`, causing `env-example.txt` to be copied to `.env`. 2. The operator populates `GITEA_ADMIN_TOKEN` ...[truncated 856 chars]- Remediation
View remediation
