T09 · Insecure Skill Coding Practices
- Location
providers/eastmoney.py:113- Finding
Unvalidated Upstream Media URL Passed to FFmpeg
- Content
View full analysis
List[Dict[str, Any]]: out: List[Dict[str, Any]] = [] chapters = data.get("playback_chapter") or [] for idx, chapter in enumerate(chapters): for group in chapter.get("media_group") or []: media = group.get("media") or {} url = media.get("url") if not url: continue out.append( { "source": "playback_chapter", "chapter_index": idx, "format": media.get("format") or group.get("format"), "av_type": group.get("av_type"), "duration_seconds": media.get("duration"), "size_bytes": media.get("size"), "width": media.get("width"), "height": media.get("height"), "url": url.replace("http://", "https://", 1), } ) return out ``` `main.py:453-456`: ```python if page.media_candidates: report["steps"].append("media discovery: ok") media_url = page.media_candidates[0]["url"] try: audio_path = extract_audio(media_url, OUT) ``` `providers/asr.py:19-40`: ```python def extract_audio(media_url: str, out_dir: Path) -> Path: ffmpeg = shutil.which("ffmpeg") if not ffmpeg: raise ASRUnavailable("ffmpeg is not installed") out_dir.mkdir(parents=True, exist_ok=True) audio_path = out_dir / "audio.mp3" cmd = [ ffmpeg, "-y", "-i", media_url, "-vn", "-ac", "1", "-ar", "16000", str(audio_path), ] pr ...[truncated 2600 chars]- Remediation
View remediation
