MEDIUM 6.1

CVE-2026-50019: yt-dlp Cookie Leak via curl External Downloader

yt-dlp is a popular command-line tool for downloading audio and video from the web. Between September 2023 and June 2026, a vulnerability existed where cookies could be sent to the wrong website if yt-dlp was configured to use curl as its external downloader. This could happen during HTTP redirects or when downloading video fragments from different hosts than the main manifest. The flaw stems from how yt-dlp passes cookies to curl—without properly activating curl's cookie handling engine, curl will blindly send cookies to any domain it connects to, regardless of the cookie's intended scope. An attacker controlling a redirect target or hosting a fragment URL could intercept these cookies, potentially gaining access to authenticated sessions. The vulnerability was fixed in version 2026.06.09.

Source data · NVD / CISA · public domain

CVSS
3.1 · 6.1 MEDIUM · CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N
Weaknesses (CWE)
CWE-200
Affected products
1 configuration(s)
Published / Modified
2026-06-23 / 2026-06-26

NVD description (verbatim)

yt-dlp is a command-line audio/video downloader. From 2023.09.24 until 2026.06.09, if curl is used as an external downloader for yt-dlp, cookies may be leaked to an unintended host upon HTTP redirect or when the host for download fragments differs from their parent manifest's. At the file download stage, the cookies are passed by yt-dlp to the file downloader via --cookie. However, unless these are loaded from a file, this operation does not activate the cookie engine. As a result, curl will send cookies with requests to domains or paths for which the cookies are not scoped. This vulnerability is fixed in 2026.06.09.

1 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability resides in yt-dlp's cookie handling when delegating downloads to curl. When cookies are supplied via command-line arguments (rather than loaded from a file), yt-dlp does not activate curl's built-in cookie engine. Without proper cookie jar initialization and scope validation in curl, the raw cookie string passed via --cookie argument causes curl to send those cookies indiscriminately to all request targets, violating HTTP cookie scope restrictions (domain, path, secure flag). This creates a window for cross-domain cookie leakage during redirect chains or when HLS/DASH manifest fragments are served from different hosts. The root cause is the absence of cookie jar context enforcement between the parent manifest host and fragment download hosts.

Business impact

For organizations using yt-dlp with curl for automated bulk downloading (common in media, research, and archival workflows), this vulnerability could expose session tokens or authentication cookies to untrusted servers. If yt-dlp is used in environments processing authenticated feeds or premium content sources, attackers could hijack those sessions. The risk is particularly acute in CI/CD pipelines or scheduled download jobs that may run unattended against mixed or untrusted content sources. Downstream systems relying on the integrity of downloaded content could also be affected if an attacker intercepts and modifies fragments.

Affected systems

yt-dlp versions from 2023.09.24 through 2026.06.08 are vulnerable when curl is the configured external downloader. Systems using yt-dlp's default downloader (Python urllib) are not affected. The vulnerability only manifests when: (1) curl is explicitly set as the external downloader, (2) cookies are passed via command-line arguments or environment, and (3) the download involves HTTP redirects or fragment requests to differing hosts. Linux, macOS, and Windows installations of yt-dlp are equally affected if they meet these conditions.

Exploitability

Exploitation requires user interaction—specifically, a user must initiate a download targeting a URL controlled or redirected by the attacker, or the manifest must reference fragments on an attacker-controlled domain. An attacker cannot remotely trigger vulnerable downloads; they must wait for a victim to download content they have crafted or control. The attack surface is reduced by the fact that many users either do not use curl as their external downloader or do not pass cookies on the command line. However, for those who do (especially in automation contexts), the risk is moderate because the attacker only needs to control a redirect target or fragment host, not the initial manifest server.

Remediation

Upgrade yt-dlp to version 2026.06.09 or later, which implements proper cookie engine activation and scope validation when curl is used as the external downloader. Organizations unable to upgrade immediately should disable curl as the external downloader and rely on yt-dlp's built-in downloader, or avoid passing sensitive cookies via command-line arguments—instead, configure them within curl's native configuration files (e.g., ~/.curl_cookies) if the underlying curl binary supports it. For automated workflows, review the necessity of passing cookies to yt-dlp and consider network-level authentication (VPN, IP allowlisting) as an alternative.

Patch guidance

Apply yt-dlp version 2026.06.09 or any later version as soon as practicable. Organizations on managed distribution channels (Homebrew, apt, pip, etc.) should ensure they are pulling the latest version. Verify the update by running `yt-dlp --version` and confirming the reported version is 2026.06.09 or higher. After patching, no configuration changes are required—the fix is transparent to end users. If you are running yt-dlp in containers or CI/CD pipelines, rebuild base images and redeploy to ensure all instances are updated.

Detection guidance

Monitor yt-dlp process execution for the combination of: (1) invocation with the --external-downloader curl flag, (2) presence of --cookie or --cookies-from-file arguments, and (3) requests to domains different from the manifest host (observable via network flow logs or curl verbose logging). Enable curl verbose mode (-v) on a test instance to confirm whether cookies are being sent to unintended hosts. Check browser DevTools or network monitoring tools if yt-dlp is embedded in a larger application. Review curl access logs if curl is deployed separately; look for Set-Cookie or Cookie headers crossing domain boundaries unexpectedly.

Why prioritize this

This vulnerability merits prompt but not emergency patching. The CVSS score of 6.1 (Medium) reflects the confluence of network accessibility, the requirement for user interaction, and the high confidentiality impact (cookie/session theft). It is not in the CISA KEV catalog, indicating no in-the-wild exploitation has been reported as of publication. However, the specificity of the affected workflow (curl + command-line cookies) and the 2+ year window of exposure mean that some organizations may have unknowingly deployed vulnerable instances. Prioritize patching if your organization uses yt-dlp in automated workflows with credential passing; deprioritize if you rely on yt-dlp's built-in downloader.

Risk score, explained

CVSS 6.1 (Medium) is justified by: (1) network-based attack vector (AV:N), (2) high complexity due to the need to control a redirect target or fragment host (AC:H), (3) no privilege requirement (PR:N), (4) user interaction required to trigger a download (UI:R), (5) scope change because the attacker can affect resources beyond the security scope of the vulnerable component (S:C), and (6) high confidentiality impact via cookie theft (C:H). Integrity and availability are not impacted (I:N, A:N). The score does not account for the narrow conditions (curl must be configured, cookies must be passed on command line), which somewhat elevates the practical risk if you match those conditions.

Frequently asked questions

Does this affect yt-dlp if I use the default downloader instead of curl?

No. The vulnerability only occurs when curl is explicitly configured as the external downloader via --external-downloader curl. yt-dlp's built-in Python-based downloader does not have this vulnerability.

What if I load cookies from a file instead of passing them on the command line?

According to the CVE description, the vulnerability occurs 'unless these are loaded from a file,' suggesting that loading cookies from a file may activate curl's proper cookie engine. However, you should verify this behavior with your specific curl version and consider upgrading to 2026.06.09 or later to ensure complete protection.

Can I be exploited if I download from a trusted source?

If the trusted source uses HTTP redirects or serves fragments from third-party CDNs, you could be vulnerable. An attacker controlling the redirect destination or CDN domain could intercept your cookies. Always verify that your yt-dlp configuration does not pass sensitive credentials via command-line arguments.

Is there a workaround if I cannot upgrade immediately?

Yes. Stop using curl as the external downloader (remove --external-downloader curl from your configuration), or stop passing cookies via command-line flags. If authentication is required, use network-level access controls (VPN, IP allowlisting) instead, or configure credentials directly in curl's config files (~/.curlrc) outside of yt-dlp's command-line argument passing.

This analysis is provided for informational purposes and reflects the state of the vulnerability as of the publication date. CVSS scores and severity ratings are based on NIST/NVD definitions and may not fully capture risk in your specific environment. Verify patch version numbers and availability dates against official vendor advisories before deployment. Security researchers and penetration testers must obtain proper authorization before testing this vulnerability on any system you do not own. This vulnerability has not been added to the CISA KEV catalog as of the publication date, but that status may change. Source: NVD (public-domain), retrieved 2026-07-28. Analysis generated by SEC.co (claude-haiku-4-5).