yt-dlp command injection in --exec option

Severity: high · CVSS 7.5 · Published 2026-06-16

yt-dlp is a popular command-line tool used to download videos from various websites. A security flaw in its post-processing feature allows a malicious video to execute unauthorized commands on a user's computer if the user has configured the tool to run specific commands after a download. This could lead to a full system compromise or data theft if a user downloads a video with specially crafted titles or descriptions.

Technologies: yt-dlp (PyPI). Vendors: PyPI.

Quick answers

Is This vulnerability exploited in the wild?
No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
How severe is This vulnerability?
High severity, with a CVSS score of 7.5, published 16 June 2026.
Which products and versions are affected?
yt-dlp (PyPI) >= 2021.4.11, < 2026.6.9.
Is there a fix for This vulnerability?
A patch was published on 2026-06-09: Fixed in version 2026.06.09 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is This vulnerability attacked?
It is attacked over the network, in a software library.
Am I affected?
Check whether you run yt-dlp (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

A command injection vulnerability exists in yt-dlp's '--exec' post-processor. The component uses an 'output template syntax' that allows video metadata (like titles) to be interpolated into shell commands. While a safe conversion flag (%()q) exists to escape shell characters, other flags like %()s do not perform sanitization. An attacker can host a video with a title containing shell metacharacters (e.g., ';', '&', '|') which, when processed by a victim using a vulnerable --exec template, results in arbitrary OS command execution. This requires the victim to use the --exec flag with an unsafe template string. The issue is fixed in version 2026.06.09 by restricting allowed conversions to a safe whitelist.

Affected products

  • yt-dlp yt-dlp >= 2021.4.11, < 2026.6.9

Timeline

  • 2026-06-09: patched: Fixed in version 2026.06.09
  • 2026-06-16: advisory: GitHub Advisory GHSA-69qj-pvh9-c5wg published

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.