OS Command Injection in yt-dlp (CVE-2026-26331)
Summary
OS command injection in yt-dlp (CVE-2026-26331). Successful exploitation can lead to full system takeover. Exploitable via netrc_cmd. Mitigation: upgrade to 2026.02.21 or later.
Original description
The description as published by the source.
Summary
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.
Impact
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.
Patches
yt-dlp version 2026.02.21 fixes this issue by validating all netrc "machine" values and raising an error upon unexpected input.
Workarounds
It is recommended to upgrade yt-dlp to version 2026.02.21 as soon as possible.
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.
Details
yt-dlp's --netrc-cmd option can be used to run any arbitrary shell command to retrieve site login credentials so that the user doesn't have to store the credentials as plaintext in the filesystem. The --netrc-cmd argument is a shell command…
Source: OSV.dev (Open Source Vulnerabilities) NVD GitHub Advisory OSV
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2026-26331 has been found in yt-dlp.
Attackers can target a specific entry point like netrc_cmd over the network to misuse the product.
Successful exploitation can lead to full system takeover.
What to do: upgrade yt-dlp to 2026.02.21 or later.
If unsure, ask your IT team or search "yt-dlp CVE-2026-26331" on the vendor's site.
CVE-2026-26331 (yt-dlp) — CWE-78
Attack vector: remote (network-reachable) / unauthenticated
Attack surface: netrc_cmd / GetCourseRuIE / TeachableIE / TeachableCourseIE
Patched: 2026.02.21 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
OS command injection (CWE-78) exists in yt-dlp. Attackers reach the vulnerable code path via netrc_cmd without authentication.
Check the vendor advisory for the affected versions of yt-dlp. Attack surface: netrc_cmd / GetCourseRuIE / TeachableIE / TeachableCourseIE.
Severity: ?. Successful exploitation can lead to full system takeover.
Update to 2026.02.21.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'yt-dlp' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'yt-dlp' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
yt-dlpを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade yt-dlp to 2026.02.21ステージング環境で 2026.02.21 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
Fix status by distribution
Fixed packages published by each distribution for this CVE
- Debian DEBIAN-CVE-2026-26331 yt-dlp
- Ubuntu UBUNTU-CVE-2026-26331 yt-dlp
References
- advisory nvd.nist.gov
- package github.com
- web github.com
- web github.com
- web github.com