T09 · Insecure Skill Coding Practices
- Location
scripts/videogen.py:215- Finding
Unrestricted Server-Controlled Upload and Download Destinations
- Content
View full analysis
" raise SystemExit(f"OSS upload failed ({oss_resp.status_code}): {detail}") ``` ```python def download_file(url, out_path, timeout=300): """Stream a file download and display progress.""" print(f"[download] {out_path.name}") try: resp = requests.get(url, stream=True, timeout=timeout) resp.raise_for_status() total = int(resp.headers.get("content-length", 0)) downloaded = 0 with open(str(out_path), "wb") as f: for chunk in resp.iter_content(chunk_size=8192): if chunk: f.write(chunk) downloaded += len(chunk) if total > 0: pct = int(downloaded * 100 / total) bar = "█" * (pct // 5) + "░" * (20 - pct // 5) print(f"\r {bar} {pct}% ({downloaded // 1024}KB)", end="", flush=True) print( ...[truncated 3190 chars]- Remediation
View remediation
