CVE-2026-26331 json
yt-dlp: Arbitrary Command Injection when using the `--netrc-cmd` option
published 2026-02-23 8 mo ago modified 2026-07-13 3 mo ago also GHSA-g3gw-q23r-pgqm , PYSEC-2026-3432 , EUVD-2026-7408
- cvss
- 8.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 1.8%
- EPSS 1.8% chance of exploitation in 30 days, percentile 78%
- public exploits
- 0
- none known
Summary
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 (`{}`) in their `--netrc-cmd` argument.
Patch / fix
- pypi yt-dlp 2026.02.21
- yt-dlp_project yt-dlp 2026.02.21
- yt-dlp Debian 14 2026.02.21-1
debian advisories DEBIAN-CVE-2026-26331
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2026-26331 updated cvss 8.8
yt-dlp: yt-dlp: Arbitrary command injection via maliciously crafted URL when --netrc-cmd is used
-
Red Hat All currently supported Red Hat productsnot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- total
- Assessed
- 8 mo ago
Exploit prediction
1.82% chance of exploitation in the next 30 days, higher than 78% of all scored CVEs (FIRST EPSS, 2026-11-09).
Exploits and checks
- github.com https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-g3gw-q23r-pgqm referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| GitHub | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| OSV | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | yt-dlp | >=2023.06.21, <2026.02.21 |
2026.02.21 |
Affected products
- yt-dlp yt-dlp
Classification
- Weakness
-
- CWE-78 Improper Neutralization of Special Elements used in an OS Command
References
-
github.com
/yt-dlp/yt-dlp/commit/1fbbe29b99dc61375bf6d786f824d9fcf6ea9c1a
web, patch
-
github.com
/yt-dlp/yt-dlp/security/advisories/GHSA-g3gw-q23r-pgqm
web, exploit, mitigation, vendor-advisory
-
github.com
/yt-dlp/yt-dlp/releases/tag/2026.02.21
web, product, release-notes
-
nvd.nist.gov
/vuln/detail/CVE-2026-26331
advisory
-
github.com
/yt-dlp/yt-dlp
package
-
pypi.org
/project/yt-dlp
package
-
github.com
/advisories/GHSA-g3gw-q23r-pgqm
advisory
Sources
- CVE List CVE-2026-26331
- GitHub Advisory GHSA-g3gw-q23r-pgqm
- NVD CVE-2026-26331
- OSV PYSEC-2026-3432
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.