CVE-2023-35934: File Downloader cookie leak vulnerability in yt-dl/p

https://nvd.nist.gov/vuln/detail/CVE-2023-35934

During file downloads, yt-dlp or the external downloaders that yt-dlp employs may leak cookies on HTTP redirects to a different host, or leak them when the host for download fragments differs from their parent manifest's host.

This vulnerable behavior is present in all versions of youtube-dl, youtube-dlc and yt-dlp released since 2015.01.25. All native and external downloaders are affected, except for curl and httpie (httpie version 3.1.0 or later).

For more technical details, see the security advisory on GitHub: https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-v8mc-9377-rwjj

What do I need to do?

  • yt-dlp: Update to 2023.07.06 (or nightly 2023.07.06.185519) as soon as possible.

  • youtube-dl: A patch should be merged shortly, I'll update this post when it does.

  • youtube-dlc: Switch to yt-dlp or youtube-dl. youtube-dlc is inactive and unlikely to receive patches and updates.

Other forks are vulnerable until they are patched.

What if I am unable to update?

For users who are not able to upgrade:

  • Avoid using cookies and user authentication methods (--cookies, --cookies-from-browser, --username, --password, --netrc). While extractors may set custom cookies, these usually do not contain sensitive information.
  • Avoid using --load-info-json

Or, if authentication is a must:

  • Verify the integrity of download links from unknown sources in browser (including redirects) before passing them to yt-dlp
  • Use curl as external downloader, since it is not impacted (--downloader curl)
  • Avoid fragmented formats such as HLS/m3u8, DASH/mpd and ISM (use -f "(bv*+ba/b)[protocol~='^https?$']")