Skip to content

← Public intelligence

PyPI package

yt-dlp

Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.

Open advisories

12 actionable advisories, newest first. Withdrawn advisories and news are excluded. Coverage is partial.

  1. High, CVSS 7.5PyPIAmendedPublished

    yt-dlp: Downstream command injection via improper sanitization of yt-dlp --write-link output

    CVE-2026-55404 · GHSA-6v4j-43gg-vj32

    Affected
    • PyPI yt-dlp < 2026.7.4
    Fixed in
    2026.7.4· Vendor fix available
    Issue
    If the --write-link, --write-url-link or --write-desktop-link options are used with yt-dlp, it may produce output that can lead to downstream remote code execution. An attacker can craft a malicious metadata payload to achieve arbitrary command injection in the .url and .desktop shortcut files written by yt-dlp. This allows for malicious shell commands or malicious remote executables to run on the user's system if the user executes the generated .url or .desktop files. Details The expected result of yt-dlp's --write-link, --write-url-link and --write-desktop-link options is to write a shortcut file that points to the webpage URL for the content downloaded by yt-dlp. The --write-url-link option writes a .url shortcut file for Windows, the --write-desktop-link option writes a .desktop shortcut file for Linux, and the --write-link option may write a .url file or a .desktop file depending on the user's platform. There are two known scenarios where a remote attacker could serve a…

    Recommended action: Upgrade to 2026.7.4 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  2. High, CVSS 7.5PyPIAmendedPublished

    yt-dlp: Arbitrary command injection possible if --exec option used with yt-dlp

    GHSA-69qj-pvh9-c5wg

    Affected
    • PyPI yt-dlp >= 2021.4.11, < 2026.6.9
    Fixed in
    2026.6.9· Vendor fix available
    Issue
    yt-dlp's --exec option is vulnerable to arbitrary command injection when handling untrusted metadata if the argument uses standard string formatting (e.g. %(title)s) or other unsafe conversions. An attacker could achieve remote code execution on the user's machine via maliciously crafted metadata containing quotes or other special shell characters. Details Since yt-dlp version 2021.04.11, the --exec option has supported "output template syntax", which is a superset of Python's printf-style string formatting also used by the --output option. This means the user is able to pass a "command template" as an argument to the --exec option which will be executed by the user's shell. The command template allows for the downloaded video's metadata to be interpolated into the command string. yt-dlp implements a %()q conversion, which will shell-quote/escape any metadata value such that it is safe to be interpolated into a command string. However, there are unsafe conversions such as…

    Recommended action: Upgrade to 2026.6.9 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  3. High, CVSS 8.3PyPIAmendedPublished

    yt-dlp: Arbitrary code execution via manifest downloads with aria2c

    CVE-2026-50574 · GHSA-vx4q-3cr2-7cg2

    Affected
    • PyPI yt-dlp < 2026.6.9
    Fixed in
    2026.6.9· Vendor fix available
    Issue
    If aria2c is used as an external downloader for a fragmented manifest format (such as an HLS/DASH stream), yt-dlp passes insufficiently sanitized input to aria2c that allows an attacker to perform an arbitrary file write. On Windows platforms, this can lead to immediate arbitrary code execution. On non-Windows platforms, this can lead to arbitrary code execution upon the next invocation of yt-dlp. Details When downloading a fragmented manifest format such as an HLS or DASH stream, yt-dlp first extracts a list of all fragment URLs from the stream's manifest. If the user has selected aria2c as an external downloader, yt-dlp then constructs an input file for aria2c from the fragment URL list and passes its filepath as the argument to aria2c's -i option. aria2c's -i (or --input-file) option allows for downloading a list of URIs from the given text file. The text file must be formatted as a list of URIs separated by newlines. aria2c's format permits configuration lines for each…

    Recommended action: Upgrade to 2026.6.9 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  4. High, CVSS 8.3PyPIAmendedPublished

    yt-dlp: Dangerous file type creation via insufficient filename sanitization (Bypass of CVE-2024-38519)

    CVE-2026-50023 · GHSA-c6mh-fpjc-4pr3

    Affected
    • PyPI yt-dlp < 2026.6.9
    Fixed in
    2026.6.9· Vendor fix available
    Issue
    A vulnerability exists in yt-dlp that allows a remote attacker to write arbitrary OS-shortcut files (such as .desktop, .url, .webloc) to the user's filesystem, bypassing the remediation for CVE-2024-38519. Details The fix for CVE-2024-38519 enforced an allowlist for file extensions, in order to prevent writing files with unsafe extensions (such as .exe or .sh) during file downloads. However, this allowlist explicitly included the unsafe extensions .desktop, .url, and .webloc so that the functionality of the --write-link option (and its variants) could be preserved. These allowlist inclusions can be exploited by an attacker to write malicious OS-shortcut files in the context of a media or subtitles download. Numerous yt-dlp extractors derive the downloaded media or subtitles file extension from a potentially attacker-controlled source. An attacker could craft an m3u8 file that contains an EXT-X-MEDIA:TYPE=SUBTITLES tag with a malicious URI (e.g.,…

    Recommended action: Upgrade to 2026.6.9 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  5. Medium, CVSS 6.1PyPIAmendedPublished

    yt-dlp: File Downloader cookie leak with curl

    CVE-2026-50019 · GHSA-f7j3-774f-rfhj

    Affected
    • PyPI yt-dlp >= 2023.9.24, < 2026.6.9
    Fixed in
    2026.6.9· Vendor fix available
    Issue
    If curl is used 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. This is the equivalent to GHSA-v8mc-9377-rwjj for the curl downloader. The vulnerable behavior is present in yt-dlp released since 2023.09.24. Details 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. An example of a potential attack scenario exploiting this vulnerability: 1. an attacker has crafted a malicious website with an embedded URL designed to be detected by yt-dlp as a video download. This embedded URL has the domain of a trusted site that the user has loaded cookies for, and conducts an unvalidated redirect to a target URL. 2.…

    Recommended action: Upgrade to 2026.6.9 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  6. High, CVSS 8.8PyPIAmendedPublished

    yt-dlp: Arbitrary Command Injection when using the --netrc-cmd option

    CVE-2026-26331 · GHSA-g3gw-q23r-pgqm

    Affected
    • PyPI yt-dlp >= 2023.6.21, < 2026.2.21
    Fixed in
    2026.2.21· Vendor fix available
    Issue
    When yt-dlp's --netrc-cmd command-line option (or netrccmd Python API parameter) is used, an attacker could achieve arbitrary command injection on the user's system with a maliciously crafted URL. Impact yt-dlp maintainers assume the impact of this vulnerability to be high for anyone who uses --netrc-cmd in their command/configuration or netrccmd in their Python scripts. Even though the maliciously crafted URL itself will look very suspicious to many users, it would be trivial for a maliciously crafted webpage with an inconspicuous URL to covertly exploit this vulnerability via HTTP redirect. Users without --netrc-cmd in their arguments or netrccmd in their scripts are unaffected. No evidence has been found of this exploit being used in the wild. Patches yt-dlp version 2026.02.21 fixes this issue by validating all netrc "machine" values and raising an error upon unexpected input. Workarounds It is recommended to upgrade yt-dlp to version 2026.02.21 as soon as possible. Users…

    Recommended action: Upgrade to 2026.2.21 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  7. UnratedPyPIAmendedPublished

    yt-dlp has dependency on potentially malicious third-party code in Douyu extractors

    GHSA-3v33-3wmw-3785

    Affected
    • PyPI yt-dlp >= 2023.9.24, < 2024.7.7
    Fixed in
    2024.7.7· Vendor fix available
    Issue
    Impact yt-dlp's DouyuTV and DouyuShow extractors used a cdn.bootcdn.net URL as a fallback for fetching a component of the crypto-js JavaScript library. When the Douyu extractor is used, yt-dlp extracts this JavaScript code and attempts to execute it externally using PhantomJS. bootcdn.net is owned by the bad actor responsible for the Polyfill JS supply chain attack that has been ongoing since at least June 2023. While there is no evidence that PhantomJS has been targeted by or is vulnerable to any attacks carried out by the Polyfill JS actor, there is the possibility that malicious JavaScript code may have been downloaded/cached by yt-dlp or executed by PhantomJS. In order for this potential vulnerability to be exploited by any hypothetical attack, all 3 of the following conditions must be met: 1. The user has PhantomJS installed on their system. 2. The user passes a douyu.com or douyutv.com URL to yt-dlp as input, or passes a URL that redirects to one of these domains. 3.…

    Recommended action: Upgrade to 2024.7.7 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  8. High, CVSS 7.8PyPIAmendedPublished

    yt-dlp File system modification and RCE through improper file-extension sanitization

    CVE-2024-38519 · GHSA-79w7-vh3h-8g4j

    Affected
    • PyPI yt-dlp < 2024.7.1
    Fixed in
    2024.7.1· Vendor fix available
    Issue
    yt-dlp does not limit the extensions of downloaded files, which could lead to arbitrary filenames being created in the download folder (and path traversal on Windows). Since yt-dlp also reads config from the working directory (and on Windows executables will be executed from the yt-dlp directory) this could lead to arbitrary code being executed. Patches yt-dlp version 2024.07.01 fixes this issue by whitelisting the allowed extensions. This means some very uncommon extensions might not get downloaded; however, it will also limit the possible exploitation surface. Workarounds It is recommended to upgrade yt-dlp to version 2024.07.01 as soon as possible, always have .%(ext)s at the end of the output template, and make sure you trust the websites that you are downloading from. Also, make sure to never download to a directory within PATH or other sensitive locations like your user directory, system32, or other binaries locations. For users not able to upgrade: - Make sure the…

    Recommended action: Upgrade to 2024.7.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  9. High, CVSS 8.3PyPIAmendedPublished

    yt-dlp: --exec command injection when using %q in yt-dlp on Windows (Bypass of CVE-2023-40581)

    CVE-2024-22423 · GHSA-hjq6-52gw-2g7p

    Affected
    • PyPI yt-dlp >= 2021.4.11, < 2024.4.9
    Fixed in
    2024.4.9· Vendor fix available
    Issue
    The patch that addressed CVE-2023-40581 attempted to prevent RCE when using --exec with %q by replacing double quotes with two double quotes. However, this escaping is not sufficient, and still allows expansion of environment variables. Support for output template expansion in --exec, along with this vulnerable behavior, was added to yt-dlp in version 2021.04.11. Patches yt-dlp version 2024.04.09 fixes this issue by properly escaping %. It replaces them with %%cd:~,%, a variable that expands to nothing, leaving only the leading percent. Workarounds It is recommended to upgrade yt-dlp to version 2024.04.09 as soon as possible. Also, always be careful when using --exec, because while this specific vulnerability has been patched, using unvalidated input in shell commands is inherently dangerous. For Windows users who are not able to upgrade: - Avoid using any output template expansion in --exec other than {} (filepath). - If expansion in --exec is needed, verify the fields you…

    Recommended action: Upgrade to 2024.4.9 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  10. Medium, CVSS 5.0PyPIAmendedPublished

    yt-dlp Generic Extractor MITM Vulnerability via Arbitrary Proxy Injection

    CVE-2023-46121 · GHSA-3ch3-jhc6-5r8x

    Affected
    • PyPI yt-dlp >= 2022.10.4, < 2023.11.14
    Fixed in
    2023.11.14· Vendor fix available
    Issue
    Impact The Generic Extractor in yt-dlp is vulnerable to an attacker setting an arbitrary proxy for a request to an arbitrary url, allowing the attacker to MITM the request made from yt-dlp's HTTP session. This could lead to cookie exfiltration in some cases. <details To pass extra control data between extractors (such as headers like Referer), yt-dlp employs a concept of "url smuggling". This works by adding this extra data as json to the url fragment ("smuggling") that is then passed on to an extractor. The receiving extractor then "unsmuggles" the data from the input url. This functionality is intended to be internal only. Currently, the Generic extractor supports receiving an arbitrary dictionary of HTTP headers in a smuggled url, of which it extracts and adds them to the initial request it makes to such url. This is useful when a url sent to the Generic extractor needs a Referer header sent with it, for example. Additionally, yt-dlp has internal headers to set a proxy for a…

    Recommended action: Upgrade to 2023.11.14 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  11. High, CVSS 8.3PyPIAmendedPublished

    yt-dlp on Windows vulnerable to --exec command injection when using %q

    CVE-2023-40581 · GHSA-42h4-v29r-42qg

    Affected
    • PyPI yt-dlp >= 2021.4.11, < 2023.9.24
    Fixed in
    2023.9.24· Vendor fix available
    Issue
    Impact yt-dlp allows the user to provide shell commands to be executed at various stages in its download process through the --exec flag. This flag allows output template expansion in its argument, so that video metadata values may be used in the shell commands. The metadata fields can be combined with the %q conversion, which is intended to quote/escape these values so they can be safely passed to the shell. However, the escaping used for cmd (the shell used by Python's subprocess on Windows) did not properly escape special characters, which can allow for remote code execution if --exec is used directly with maliciously crafted remote data. This vulnerability only impacts yt-dlp on Windows, and the vulnerability is present regardless of whether yt-dlp is run from cmd or from PowerShell. Support for output template expansion in --exec, along with this vulnerable behavior, was added to yt-dlp in version 2021.04.11. Patches yt-dlp version 2023.09.24 fixes this issue by properly…

    Recommended action: Upgrade to 2023.9.24 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  12. Medium, CVSS 6.1PyPIAmendedPublished

    yt-dlp File Downloader cookie leak

    CVE-2023-35934 · GHSA-v8mc-9377-rwjj

    Affected
    • PyPI yt-dlp < 2023.7.6
    Fixed in
    2023.7.6· Vendor fix available
    Issue
    Impact 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). At the file download stage, all cookies are passed by yt-dlp to the file downloader as a Cookie header, thereby losing their scope. This also occurs in yt-dlp's info JSON output, which may be used by external tools. As a result, the downloader or external tool may indiscriminately send cookies with requests to domains or paths for which the cookies are not scoped. An example of a potential attack scenario exploiting this vulnerability: 1. an attacker has crafted a malicious website with an embedded URL designed to be detected by…

    Recommended action: Upgrade to 2023.7.6 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →