T09 · Insecure Skill Coding Practices
- Location
run_rough_cut.py:31- Finding
Unrestricted API destination can disclose selected local video files
- Content
View full analysis
tuple[bytes, str]: boundary = "----CodexRoughCutBoundary" chunks: list[bytes] = [] for key, value in data.items(): chunks.extend([ f"--{boundary}\r\n".encode(), f'Content-Disposition: form-data; name="{key}"\r\n\r\n'.encode(), str(value).encode(), b"\r\n", ]) mime = mimetypes.guess_type(file_path.name)[0] or "application/octet-stream" file_bytes = file_path.read_bytes() chunks.extend([ f"--{boundary}\r\n".encode(), f'Content-Disposition: form-data; name="file"; filename="{file_path.name}"\r\n'.encode(), f"Content-Type: {mime}\r\n\r\n".encode(), file_bytes, b"\r\n", f"--{boundary}--\r\n".encode(), ]) return b"".join(chunks), boundary ``` ```python def submit_job(args: argparse.Namespace) -> dict: video = Path(args.video).expanduser().resolve() if not video.exists(): raise FileNotFoundError(f"Video not found: {video}") data = { "name": args.name or video.stem, "platform_preset": args.platform_preset, "remove_pauses": bool_string(args.remove_pauses), "remove_breaths": bool_string(args.remove_breaths), "adjust_brightness": bool_string(args.adjust_brightness), "apply_beauty": bool_string(args.beauty_mode != "off"), "trim_head_tail": bool_string(args.trim_head_tail), "auto_center": bool_string(args.auto_center), "stabilize": bool_string(args.stabilize), "denoise_audio": bool_string(args.denoise_audio), ...[truncated 2862 chars]- Remediation
View remediation
