Skip to content

Proof of Concept for an arbitrary command injection vulnerability in yt-dlp’s --netrc-cmd option (GHSA-g3gw-q23r-pgqm / CVE-2026-26331). Demonstrates shell command execution via maliciously crafted URLs in affected versions (≥ 2023.06.21, < 2026.02.21).

Notifications You must be signed in to change notification settings

dxlerYT/CVE-2026-26331

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Arbitrary Command Injection via --netrc-cmd in yt-dlp

Severity: High (CVSS 8.8)
Affected Software: yt-dlp >= 2023.06.21, < 2026.02.21
Patched In: 2026.02.21
Advisory: GHSA-g3gw-q23r-pgqm
CVE: CVE-2026-26331


Summary

yt-dlp’s --netrc-cmd command-line option (or netrc_cmd Python API parameter) can be abused to achieve arbitrary command execution when combined with a maliciously crafted URL. This allows an attacker to execute arbitrary shell commands on the user’s system.


Details

The --netrc-cmd option allows users to execute a shell command to retrieve login credentials dynamically, optionally replacing a placeholder {} with the netrc "machine" value. Some extractors (e.g., GetCourseRuIE, TeachableIE, TeachableCourseIE) allow wildcard hostnames, which may contain shell-special characters. Because yt-dlp executes --netrc-cmd using subprocess.Popen(shell=True), a malicious URL can inject arbitrary commands.


PoC

yt-dlp --netrc-cmd "echo {}" "https://;touch /tmp/pwned;#.getcourse.ru/video"

Impact

  • Attack Vector: Network
  • Attack Complexity: Low
  • Privileges Required: None
  • User Interaction: Required
  • Impact: High confidentiality, integrity, and availability impact

Mitigation

  • Upgrade yt-dlp to version 2026.02.21 or later.
  • Avoid using --netrc-cmd or netrc_cmd.
  • If unavoidable, do not pass placeholders ({}) to --netrc-cmd.

References

About

Proof of Concept for an arbitrary command injection vulnerability in yt-dlp’s --netrc-cmd option (GHSA-g3gw-q23r-pgqm / CVE-2026-26331). Demonstrates shell command execution via maliciously crafted URLs in affected versions (≥ 2023.06.21, < 2026.02.21).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published