# yt-dlp command injection in --exec option

Source: https://junglewise.ai/threats/yt-dlp-command-injection-in-exec-option-89f9590f  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-16. Updated: 2026-06-16  
License: CC BY 4.0 with a link back

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)](https://junglewise.ai/threats/technologies/yt-dlp). Vendors: [PyPI](https://junglewise.ai/threats/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

- [https://api.github.com/users/independent-arg](https://api.github.com/users/independent-arg)
- [https://github.com/independent-arg](https://github.com/independent-arg)
- [https://api.github.com/users/independent-arg/gists%7B/gist_id%7D](https://api.github.com/users/independent-arg/gists%7B/gist_id%7D)
- [https://api.github.com/users/independent-arg/repos](https://api.github.com/users/independent-arg/repos)
- [https://avatars.githubusercontent.com/u/251550460?v=4](https://avatars.githubusercontent.com/u/251550460?v=4)
- [https://api.github.com/users/independent-arg/events%7B/privacy%7D](https://api.github.com/users/independent-arg/events%7B/privacy%7D)

## Related threats

- [PYSEC-2026-3432 - yt-dlp: Arbitrary Command Injection when using the `--netrc-cmd` option](https://junglewise.ai/threats/cve-2026-26331-yt-dlp-arbitrary-command-injection-when-using-the-netrc-cmd)
- [yt-dlp and youtube-dl command injection in shortcut file generation](https://junglewise.ai/threats/cve-2026-55404-yt-dlp-and-youtube-dl-command-injection-in-shortcut-file)
- [PYSEC-2026-2065 - yt-dlp File system modification and RCE through improper file-extension sanitization](https://junglewise.ai/threats/cve-2024-38519-yt-dlp-file-system-modification-and-rce-through-improper-file)
- [PYSEC-2026-2066 - yt-dlp: `--exec` command injection when using `%q` in yt-dlp on Windows (Bypass of )](https://junglewise.ai/threats/cve-2024-22423-yt-dlp-exec-command-injection-when-using-q-in-yt-dlp-on-windows)
- [PYSEC-2026-2063 - yt-dlp Generic Extractor MITM Vulnerability via Arbitrary Proxy Injection](https://junglewise.ai/threats/cve-2023-46121-yt-dlp-generic-extractor-mitm-via-arbitrary-proxy-injection)
