Skip to main content
Public proof of conceptFix available

CVE-2026-26331

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

A public proof of concept exists; no exploitation attested.

  • Published2026-02-24
  • Fixed in2026.02.21
  • WeaknessCWE-78

Am I affected?

With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.

Description

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.

Timeline

dates in UTC
  1. 2026-02-2403:16CVE publishedNVD

Versions per branch

NVD · OSV
Yt-dlp project yt-dlp
BranchAffectedFixed in
2026.2≥ 2023.06.21, < 2026.02.212026.02.21

as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.

Products declared by the CNA1 product

As GitHub_M, the CNA that assigned this CVE, declared them in the CVE record; versions as written.

  • yt-dlp
    Affected
    • = >= 2023.06.21, < 2026.02.21no fix stated

Source: the CNA record (CVE Program), © The MITRE Corporation,CVE Terms of UseCVE recordupdated 2026-02-24

Distribution builds and vendor advisories

Packages from OSV.dev and products from the vendors' CSAF advisories.

version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.

Packages

  • rootio-yt-dlpRoot:PyPIall versions · fixed in 2025.10.22+root.io.1
  • rootio-yt-dlpRoot:PyPIall versions · fixed in 2025.10.22+root.io.2
  • yt-dlpUbuntu:26.10all versions · no fixed version listed
  • yt-dlpUbuntu:26.04:LTSall versions · no fixed version listed
  • yt-dlpUbuntu:25.10all versions · no fixed version listed
  • yt-dlpUbuntu:24.04:LTSall versions · no fixed version listed
  • yt-dlpUbuntu:22.04:LTSall versions · no fixed version listed
  • yt-dlpRoot:PyPIall versions · fixed in 2025.10.22+aikido.2

3 more package ranges on OSV.dev

Vendor advisories

  • CVE-2026-26331 Red Hat Product Security

    yt-dlp: yt-dlp: Arbitrary command injection via maliciously crafted URL when --netrc-cmd is used

Full record on NVD

Fix

  1. Update Yt-dlp project yt-dlp to 2026.02.21

Advisories and patches

Detection

read 2026-11-01 01:02 UTC
Nuclei template
none so far
ProjectDiscovery
Exploit-DB
no entry
Exploit-DB
Proof of concept
Metasploit modules
none listed
Metasploit Framework

Sources

Identifiers

Technical details

CVSS v3 Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Published
2026-02-24
Last Modified
2026-06-17
NVD status
Analyzed
GitHub Advisory
GHSA-g3gw-q23r-pgqm

Frequently asked questions

What is CVE-2026-26331?

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.

Is CVE-2026-26331 actively exploited?

Active exploitation of CVE-2026-26331 has not been confirmed. Its EPSS score was 1.8% on 2026-11-09, the estimated probability of exploitation in the next 30 days.

What is the CVSS score for CVE-2026-26331?

CVE-2026-26331 has a CVSS v3 base score of 8.8 (HIGH severity), with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.

Running yt-dlp? Hear about its next vulnerability

Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».

No credit card required · No monthly cap on website lookups · 250 API requests/month

Sources for this record