CVE-2026-50574: yt-dlp Arbitrary Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-vx4q-3cr2-7cg2
CVSS 8.3
CWE-74
Published
Advisory Summary

CVE-2026-50574 is a HIGH (CVSS 8.3) arbitrary code execution vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting yt-dlp libraries in the PyPI ecosystem. The issue involves arbitrary code execution via manifest downloads with aria2c. Remediation is available by upgrading affected packages to version 2026.6.9.

CVE-2026-50574 at a Glance

CVE Identifier CVE-2026-50574
GHSA Identifier GHSA-vx4q-3cr2-7cg2
Severity HIGH
CVSS v3.1 Base Score 8.3
CWE Classification CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Affected Product yt-dlp
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-50574

To remediate this vulnerability, upgrade all affected yt-dlp dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

yt-dlp fixed: 2026.6.9
pip install yt-dlp>=2026.6.9
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show yt-dlp

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-50574, inspect your installed packages using pip:

pip show yt-dlp

Analyze the terminal output to locate any version of yt-dlp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2026.6.9), your application is affected.

Note: The pip show yt-dlp command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. In yt-dlp, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary 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 URI, which can contain command-line options to be given to aria2c. These optional lines follow each URI line and are signified only by leading whitespace. yt-dlp constructs the input file with these optional lines so that it's able to specify the output filename for each fragment using the `out=` option. yt-dlp's utilization of the aria2c input file format presents two known attack vectors: 1. An attacker can craft a malicious DASH manifest with one or more fragment URLs that contain `
`, which is the HTML escape sequence for a newline. yt-dlp interprets this escape sequence as an actual newline character when writing the fragment URLs to the aria2c input file, which allows for an attacker to inject arbitrary aria2c options into the input file. With option injection, the attacker can achieve arbitrary file writes. This attack vector is possible only via downloads of DASH formats, since their manifests are an XML format which necessitates unescaping of HTML special characters. 2. An attacker can craft a malicious metadata response where the data parsed by yt-dlp as the `title` field (or any other metadata field that the user includes in their output template) contains strategically placed newlines and magnet URIs. If the user has passed the `--no-windows-filename` option to disable sanitization of newlines in output filenames, the attacker is able to achieve arbitrary file writes by injecting arbitrary URIs and options into the aria2c input file. This attack vector is possible via downloads of both HLS and DASH formats. On Windows, attacker-controlled file writes can lead to immediate arbitrary code execution: the attacker could write a malicious executable file named `ffmpeg.exe` to the current working directory, and it could be invoked during the postprocessing stage if the user's `yt-dlp.exe` also resides in the current working directory. On all platforms, attacker-controlled file writes can lead to arbitrary code execution on repeat invocations of yt-dlp: the attacker could write a yt-dlp configuration file (`yt-dlp.conf`) to the current working directory containing a malicious `--exec` argument. ### Patches yt-dlp version 2026.06.09 fixes this issue by removing support for downloading fragmented manifest formats with aria2c. ### Workarounds It is recommended to upgrade yt-dlp to version 2026.06.09 as soon as possible. For users who are not able to upgrade: - Add `--downloader dash,m3u8:native` to your yt-dlp command.

CVE-2026-50574 Affected yt-dlp Versions

1 component(s)
Fixed Versions:
2026.6.9
Product / Package Ecosystem Affected Versions Fixed Version
yt-dlp
PyPI
< 2026.6.9
2026.6.9

References

Frequently Asked Questions

What is CVE-2026-50574?
CVE-2026-50574 is a security vulnerability in yt-dlp involving Arbitrary code execution via manifest downloads with aria2c under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection').
Which yt-dlp versions are affected?
Affected versions include releases prior to 2026.6.9 across affected packages: yt-dlp.
What version fixes CVE-2026-50574?
Upgrading to 2026.6.9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is yt-dlp affected?
Yes, yt-dlp is affected in releases prior to 2026.6.9. Upgrade your dependency to 2026.6.9 or later.
What is the CVSS score of CVE-2026-50574?
CVE-2026-50574 has a CVSS v3.1 base score of 8.3 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2026-50574?
CVE-2026-50574 is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') (The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.).
How can I check PyPI dependencies for CVE-2026-50574?
Run the dependency tree command: 'pip show yt-dlp'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vx4q-3cr2-7cg2",
  "modified" : "2026-07-20T13:46:06Z",
  "published" : "2026-06-16T21:13:47Z",
  "aliases" : [ "CVE-2026-50574" ],
  "summary" : "yt-dlp: Arbitrary code execution via manifest downloads with aria2c",
  "details" : "### Summary\nIf 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.\n\n### Details\nWhen 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.\n\naria2c'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 URI, which can contain command-line options to be given to aria2c. These optional lines follow each URI line and are signified only by leading whitespace. yt-dlp constructs the input file with these optional lines so that it's able to specify the output filename for each fragment using the `out=` option.\n\nyt-dlp's utilization of the aria2c input file format presents two known attack vectors:\n\n1. An attacker can craft a malicious DASH manifest with one or more fragment URLs that contain `&#10;`, which is the HTML escape sequence for a newline. yt-dlp interprets this escape sequence as an actual newline character when writing the fragment URLs to the aria2c input file, which allows for an attacker to inject arbitrary aria2c options into the input file. With option injection, the attacker can achieve arbitrary file writes. This attack vector is possible only via downloads of DASH formats, since their manifests are an XML format which necessitates unescaping of HTML special characters.\n\n2. An attacker can craft a malicious metadata response where the data parsed by yt-dlp as the `title` field (or any other metadata field that the user includes in their output template) contains strategically placed newlines and magnet URIs. If the user has passed the `--no-windows-filename` option to disable sanitization of newlines in output filenames, the attacker is able to achieve arbitrary file writes by injecting arbitrary URIs and options into the aria2c input file. This attack vector is possible via downloads of both HLS and DASH formats.\n\nOn Windows, attacker-controlled file writes can lead to immediate arbitrary code execution: the attacker could write a malicious executable file named `ffmpeg.exe` to the current working directory, and it could be invoked during the postprocessing stage if the user's `yt-dlp.exe` also resides in the current working directory.\n\nOn all platforms, attacker-controlled file writes can lead to arbitrary code execution on repeat invocations of yt-dlp: the attacker could write a yt-dlp configuration file (`yt-dlp.conf`) to the current working directory containing a malicious `--exec` argument.\n\n### Patches\nyt-dlp version 2026.06.09 fixes this issue by removing support for downloading fragmented manifest formats with aria2c.\n\n### Workarounds\nIt is recommended to upgrade yt-dlp to version 2026.06.09 as soon as possible.\n\nFor users who are not able to upgrade:\n\n- Add `--downloader dash,m3u8:native` to your yt-dlp command.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "yt-dlp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2026.6.9"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-vx4q-3cr2-7cg2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-50574"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/yt-dlp/yt-dlp/commit/25056f0d2d47adbd235a8d422fa62d68d0be2bc2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-vx4q-3cr2-7cg2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/yt-dlp/PYSEC-2026-3433.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/yt-dlp/yt-dlp"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/tag/2026.06.09.230517"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/yt-dlp/yt-dlp/releases/tag/2026.06.09"
  }, {
    "type" : "WEB",
    "url" : "https://pypi.org/project/yt-dlp"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-74" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-16T21:13:47Z",
    "nvd_published_at" : "2026-06-23T17:17:03Z"
  }
}