T09 · Insecure Skill Coding Practices
Error
- Location
- scripts/download_audio.py:83
- Finding
- TLS Certificate Verification Disabled in YouTube Downloader<![CDATA[ ## Vulnerability Details **File Locations**: - `scripts/download_audio.py:83-94` - `scripts/download_audio_simple.py:85-97` **Vulnerability Type**: Improper certificate validation **Risk Level**: High ### Vulnerable Code `scripts/download_audio.py:83-94`: ```python cmd = [ ytdlp_cmd, '-x', # Extract audio '--audio-format', 'mp3', # Convert to MP3 '--audio-quality', '0', # Best quality '-o', output_template, '--no-check-certificates', # 跳过证书检查 '--extractor-args', 'youtube:player_client=android', # 使用 Android 客户端 '--user-agent', 'Mozilla/5.0 (Linux; Android 13) AppleWebKit/537.36', # Android UA youtube_url ] ``` `scripts/download_audio_simple.py:85-97`: ```python cmd = [ ytdlp_cmd, '-f', 'bestaudio/best', # 下载最佳音频流,或最佳视频流 '--extract-audio', # 提取音频 '-o', output_template, '--no-check-certificates', '--extractor-args', 'youtube:player_client=android,web', '--user-agent', 'Mozilla/5.0 (Linux; Android 13) AppleWebKit/537.36', '--no-warnings', youtube_url ] ``` ### Technical Analysis Both downloader implementations pass `--no-check-certificates` to `yt-dlp`. This option disables TLS server-certificate validation for network requests made by the downloader. TLS certificate validation is responsible for authenticating remote servers and preventing an intermediary from impersonating them. Encryption without certificate verification does not provide reliable endpoint authentication. A network-positioned attacker could therefore present a forged certificate and return attacker-controlled responses. The bypass is not required by the Skill's declared YouTube download and cloud-transcription functionality. It expands the network trust boundary beyond what is necessary and is particularly dangerous when combined with the insufficient URL validation documented separately. ### Attack Path 1. A user or Agent invokes either downloader with a supported-looking URL. 2. The script star ...[truncated 1339 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove `--no-check-certificates` from both downloader command arrays. 2. Retain the operating system and Python certificate-store defaults. 3. If certificate validation fails, fix the underlying trust-store, proxy, or CA configuration rather than bypassing authentication. 4. Reject HTTPS interception proxies unless their CA has been deliberately installed by the system administrator. 5. Add automated tests that verify neither downloader passes certificate-bypass options to `yt-dlp`. 6. Combine this correction with strict URL parsing and hostname allowlisting. ]]>
