T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/download.mjs:100
- Finding
- TLS Certificate Verification Disabled for All Downloads<![CDATA[ ## Vulnerability Details **File Location**: `scripts/download.mjs`, lines 100–106 **Vulnerability Type**: Improper certificate validation **Risk Level**: Medium ### Vulnerable Code ```js const ydlArgs = [ '-f', `${quality}[ext=mp4]/best`, '--output', outputTemplate, '--no-warnings', '--socket-timeout', '30', '--no-check-certificate' // Only if needed for proxy ]; ``` ### Technical Analysis The script unconditionally passes `--no-check-certificate` to `yt-dlp`. This disables TLS certificate verification for every download, even when no proxy is configured. TLS certificate validation establishes that the remote endpoint is the intended Twitter/X service. Disabling it allows an attacker who controls or can intercept the network path to present an untrusted certificate without causing the connection to fail. The inline comment indicates that this behavior was intended only for exceptional proxy configurations, but the option is always enabled. ### Attack Path 1. A user invokes the Skill to download media from an HTTPS Twitter/X URL. 2. The script starts `yt-dlp` with `--no-check-certificate`. 3. An attacker controls the configured proxy, local network, DNS resolution, or another relevant network component. 4. The attacker intercepts the HTTPS connection and presents an invalid or attacker-controlled certificate. 5. Because certificate verification is disabled, `yt-dlp` accepts the connection. 6. The attacker can observe or modify extractor responses and downloaded content before it is written to the selected output directory. ### Impact Assessment Successful exploitation does not directly grant additional local operating-system privileges. It compromises the confidentiality and integrity of network traffic handled by `yt-dlp`. An attacker positioned on the network path may observe requests, manipulate responses, or substitute downloaded media within the scope of the download operation. ]]>
- Remediation
- <![CDATA[ ## Remediation Suggestions Remove `--no-check-certificate` from the default argument list and rely on normal TLS certificate validation: ```js const ydlArgs = [ '-f', `${quality}[ext=mp4]/best`, '--output', outputTemplate, '--no-warnings', '--socket-timeout', '30' ]; ``` If disabling validation is unavoidable in a particular environment: 1. Require an explicit command-line option or dedicated environment variable. 2. Keep the insecure mode disabled by default. 3. Display a prominent warning when it is enabled. 4. Prefer configuring the correct private certificate authority rather than bypassing verification. 5. Document that the option exposes traffic to interception and content substitution. ]]>
