KeygraphLabs · CVE MCP

CVE-2026-26331 · GitHub_M

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

yt-dlp is a command-line audio/video downloader. Starting in version 2023.06.21 and prior to version 2026.02.21, when yt-dlp's `--netrc-cmd` command-line option (or `netrc_cmd` Python API parameter) is used, an attacker could achieve arbitrary command injection on the user's system with a maliciously crafted URL. yt-dlp maintainers assume the impact of this vulnerability to be high for anyone who uses `--netrc-cmd` in their command/configuration or `netrc_cmd` 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 `netrc_cmd` in their scripts are unaffected. No evidence has been found of this exploit being used in the wild. yt-dlp version 2026.02.21 fixes this issue by validating all netrc "machine" values and raising an error upon unexpected input. As a workaround, users who are unable to upgrade should avoid using the `--netrc-cmd` command-line option (or `netrc_cmd` Python API parameter), or they should at least not pass a placeholder...

Published 2026-02-24, last changed 2026-06-17. Weakness: CWE-78.

CVSS
8.8
high, from the CNA
EPSS
1.79%
percentile 79.2%, chance of exploitation in 30 days
Exploitation
None known
no KEV listing or public exploit in our indexes

How to fix

Upgrade to a fixed version: yt-dlp 2026.02.21 (PyPI). For the version that clears every advisory for your installed version, ask an agent for get_remediation.

Where the flaw is in the code

Fixed in yt-dlp/yt-dlp by 1fbbe29b99, e2a9cc7d13. Functions changed by the fix: initialize, _get_netrc_login_info, GetCourseRuIE, PornHubIE, PornHubUserIE, TeachableIE, TeachableCourseIE. Regression tests: test/test_InfoExtractor.py. Confidence: verified (a record names this commit as the fix, and it changed these functions).

Timeline

2026-02-23Package advisory GHSA-g3gw-q23r-pgqm
2026-02-24Published
2026-06-17Record last changed
2026-07-13Package advisory PYSEC-2026-3432
2026-11-30EPSS when our history starts: 2.37%
2026-12-03Code-level analysis added

Affected packages

AdvisoryPackageFixed in
GHSA-g3gw-q23r-pgqmyt-dlp (PyPI)2026.02.21
PYSEC-2026-3432yt-dlp (PyPI)2026.02.21

Also known as: GHSA-g3gw-q23r-pgqm, PYSEC-2026-3432

Related

CVEPublishedCVSSSummary
CVE-2026-554042026-07-088.8yt-dlp: Downstream command injection via improper sanitization of yt-dlp --write-link output
CVE-2026-505742026-06-239.6yt-dlp: Arbitrary code execution via manifest downloads with aria2c
CVE-2026-500232026-06-239.6yt-dlp: Dangerous file type creation via insufficient filename sanitization (Bypass of CVE-2024-38519)
CVE-2026-500192026-06-237.4yt-dlp: File Downloader cookie leak with curl
CVE-2024-385192024-07-027.8yt-dlp and youtube-dl vulnerable to file system modification and RCE through improper file-extension sanitization
CVE-2024-224232024-04-099.8yt-dlp `--exec` command injection when using `%q` in yt-dlp on Windows
CVE-2023-461212023-11-153.7Generic Extractor MITM Vulnerability in yt-dlp
CVE-2023-405812023-09-257.8yt-dlp command injection when using `%q` in `--exec` on Windows

Add it to your agent

One command for Claude Code; setup for Claude Desktop, Cursor and others. No signup or key.

claude mcp add --transport http keygraph-cve https://cve-mcp.keygraph.io/mcp

Then ask for triage_cve CVE-2026-26331, or call /api/v1/vulnerabilities/CVE-2026-26331. To prove whether it is exploitable in your running app, run Shannon, Keygraph's open-source AI pentester.

NVD · CVE.org