T08 · Insecure Dependencies
- Location
references/install_tools.md:39- Finding
Unverified Executable Downloads from Third-Party GitHub Proxies
- Content
View full analysis
" # is chosen by the invoking agent (recommended: ~/bin/videolink-to-article/) New-Item -ItemType Directory -Force -Path $tools | Out-Null $mirrors = @( "https://gh-proxy.com/https://github.com/nilaoda/BBDown/releases/download/1.6.3/BBDown_1.6.3_20240814_win-x64.zip", "https://ghproxy.net/https://github.com/nilaoda/BBDown/releases/download/1.6.3/BBDown_1.6.3_20240814_win-x64.zip", "https://mirror.ghproxy.com/https://github.com/nilaoda/BBDown/releases/download/1.6.3/BBDown_1.6.3_20240814_win-x64.zip" ) foreach ($u in $mirrors) { curl.exe -L --max-time 60 -o "$tools\BBDown.zip" $u if ((Test-Path "$tools\BBDown.zip") -and ((Get-Item "$tools\BBDown.zip").Length -gt 100000)) { break } Remove-Item "$tools\BBDown.zip" -ErrorAction SilentlyContinue } Expand-Archive -Path "$tools\BBDown.zip" -DestinationPath $tools -Force Remove-Item "$tools\BBDown.zip" ``` The same guide downloads the standalone yt-dlp executable without integrity verification: ```powershell $tools = "" # recommended: ~/bin/videolink-to-article/ New-Item -ItemType Directory -Force -Path $tools | Out-Null # Direct from GitHub. If TLS handshake fails, switch to the gh-proxy.com mirror below. curl.exe -L --max-time 600 --retry 2 -o "$tools\yt-dlp.exe" ` "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe" # Mirror fallback for restrictive networks: # curl.exe -L --max-time 600 --retry 2 -o "$tools\yt-dlp.exe" ` # "https://gh-proxy.com/https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe" & "$tools\yt-dlp.exe" ...[truncated 2205 chars]- Remediation
View remediation
" $actual = (Get-FileHash "$tools\BBDown.zip" -Algorithm SHA256).Hash.ToLowerInvariant() if ($actual -ne $expected.ToLowerInvariant()) { Remove-Item "$tools\BBDown.zip" -Force throw "BBDown integrity verification failed" } ``` 5. Validate Authenticode signatures where the publisher provides signed Windows artifacts. 6. Do not treat file size, archive validity, or successful `--version` output as proof of authenticity. 7. Do not automatically fall back to third-party executable mirrors. Require explicit user approval and display the trust implications. 8. Extract downloads into a temporary staging directory, verify the expected filenames, and only then move verified artifacts into the persistent tools directory. ]]>
