T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- scripts/summarize.py:170
- Finding
- Authenticated Browser Requests Are Made with TLS Certificate Verification Disabled<![CDATA[ ## Vulnerability Details **File Location**: `scripts/summarize.py:170-180` **Vulnerability Type**: Authenticated network communication without certificate verification **Risk Level**: High ### Vulnerable Code ```python # Step 1: Download video print(" 📥 Downloading video...", file=sys.stderr) download_cmd = [ "yt-dlp", "--cookies-from-browser", "chrome", "--no-check-certificates", "-f", "bestvideo[height<=720]+bestaudio/best[height<=720]", "--merge-output-format", "mp4", "-o", video_path, url, ] subprocess.run(download_cmd, check=True, timeout=300) ``` ### Technical Analysis The Bilibili download operation instructs `yt-dlp` to obtain authentication cookies from the user's Chrome browser while simultaneously disabling TLS certificate verification. The `--no-check-certificates` option prevents `yt-dlp` from validating whether the remote server presents a certificate issued for the expected host by a trusted certificate authority. HTTPS encryption without certificate authentication does not protect against an active man-in-the-middle attacker. Because browser cookies are enabled in the same command, requests may carry authenticated session information. Although cookie domain rules normally limit which cookies are attached to a request, a network attacker capable of intercepting traffic to the relevant domain can impersonate that domain when certificate verification is disabled. Reading the user's general Chrome authentication state also grants broader access than is necessary for summarizing public videos. A dedicated, narrowly scoped cookie file or browser profile would follow least-privilege principles more closely. ### Attack Path 1. A user invokes the Skill to summarize a Bilibili video. 2. The Skill launches `yt-dlp` with Chrome browser cookies. 3. The user is connected through a hostile Wi-Fi network, compromised proxy, malicious DNS resolver, or another attacker-controlled network path. 4. The attacker redi ...[truncated 945 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove `--no-check-certificates` and require normal TLS certificate validation. 2. Treat certificate failures as fatal rather than silently weakening transport security. 3. Do not read the user's default Chrome profile automatically. 4. Make authenticated browser access explicitly opt-in and explain why it is required. 5. Prefer a dedicated browser profile or user-supplied cookie file containing only the minimum cookies needed for Bilibili. 6. Provide a public-video mode that never accesses browser cookies. 7. Avoid printing cookie values, request headers, or authenticated URLs in logs. 8. Document how users can revoke the dedicated session if compromise is suspected. ]]>
