T09 · Insecure Skill Coding Practices
- Location
env-example.txt:1- Finding
Administrator Token and Knowledge-Base Documents 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, ) ``` ```python # scripts/save_document.py:55-73 g.put_file(args.owner, args.repo, path, content, f"paper-kb ingest: {fname}") archived_path = "" archived_url = "" if args.source_file_path: raw_path = Path(args.source_file_path) if raw_path.exists(): ext = raw_path.suffix.lower() if ext == ".pdf": folder_name = "pdfs" elif ext in {".docx", ".doc"}: folder_name = "docs" elif ext in {".xlsx", ".xls"}: folder_name = "sheets" elif ext in {".txt", ".md", ".markdown"}: folder_name = "text" else: folder_name = "other" archived_path = f"source_files/{folder_name}/{fname}{ext or '.bin'}" g.put_file_bytes(args ...[truncated 2075 chars]- Remediation
View remediation
