The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-26331

CVE-2026-26331: Yt-dlp Command Injection RCE Vulnerability

CVE-2026-26331 is a command injection RCE vulnerability in yt-dlp affecting versions 2023.06.21 to 2026.02.21. Attackers can execute arbitrary commands when --netrc-cmd is used. This article covers technical details, affected versions, impact, and mitigation steps.

Published: February 27, 2026

CVE-2026-26331 Overview

CVE-2026-26331 is a command injection vulnerability affecting yt-dlp, a popular command-line audio/video downloader. The vulnerability exists in versions starting from 2023.06.21 and prior to 2026.02.21. When the --netrc-cmd command-line option or netrc_cmd Python API parameter is used, an attacker can achieve arbitrary command injection on a user's system through a maliciously crafted URL.

The yt-dlp maintainers assess the impact of this vulnerability as high for anyone utilizing --netrc-cmd in their command/configuration or netrc_cmd in their Python scripts. While the malicious URL itself may appear suspicious, it would be trivial for an attacker to create a seemingly innocent webpage that covertly exploits this vulnerability through HTTP redirects. Users who do not use --netrc-cmd or netrc_cmd are not affected. No evidence has been found of this exploit being used in the wild.

Critical Impact

Arbitrary command execution on systems using yt-dlp with --netrc-cmd option enabled, allowing attackers to fully compromise the target machine through maliciously crafted URLs or HTTP redirects.

Affected Products

  • yt-dlp versions 2023.06.21 through 2026.02.20
  • yt-dlp Python library with netrc_cmd parameter usage
  • Systems running yt-dlp with --netrc-cmd command-line option configured

Discovery Timeline

  • 2026-02-24 - CVE-2026-26331 published to NVD
  • 2026-02-25 - Last updated in NVD database

Technical Details for CVE-2026-26331

Vulnerability Analysis

This vulnerability is classified as CWE-78 (OS Command Injection). The flaw allows remote attackers to execute arbitrary commands on the target system when yt-dlp processes a specially crafted URL while the --netrc-cmd option is in use. The vulnerability is exploitable over the network and requires user interaction (such as clicking a link or being redirected to a malicious URL), but requires no authentication or special privileges.

The attack can be particularly effective because even if users might recognize a suspicious URL, attackers can leverage HTTP redirects from legitimate-looking webpages to deliver the exploit payload, making detection difficult for end users.

Root Cause

The root cause of CVE-2026-26331 lies in insufficient validation of the netrc_machine parameter values before they are passed to shell commands. The vulnerable code failed to restrict input to shell-safe characters, allowing attackers to inject arbitrary commands through specially crafted URL patterns that would be interpreted as valid machine identifiers but contain command injection payloads.

Attack Vector

The attack vector operates through network-based exploitation requiring user interaction. An attacker crafts a malicious URL containing command injection sequences that target the netrc machine parameter processing. When a user with --netrc-cmd configured attempts to process this URL (either directly or via an HTTP redirect from an innocuous-looking page), the injected commands execute with the privileges of the user running yt-dlp.

The following patch demonstrates how the vulnerability was addressed by limiting input to shell-safe characters:

python
         'marafon.mani-beauty.com',
         'on.psbook.ru',
     ]
-    _BASE_URL_RE = rf'https?://(?:(?!player02\.)[^.]+\.getcourse\.(?:ru|io)|{"|".join(map(re.escape, _DOMAINS))})'
+    _BASE_URL_RE = rf'https?://(?:(?!player02\.)[a-zA-Z0-9-]+\.getcourse\.(?:ru|io)|{"|".join(map(re.escape, _DOMAINS))})'
     _VALID_URL = [
         rf'{_BASE_URL_RE}/(?!pl/|teach/)(?P<id>[^?#]+)',
         rf'{_BASE_URL_RE}/(?:pl/)?teach/control/lesson/view\?(?:[^#]+&)?id=(?P<id>\d+)',

Source: GitHub Commit Update

The fix changes the URL regex pattern from accepting any character except dots ([^.]+) to only accepting alphanumeric characters and hyphens ([a-zA-Z0-9-]+), preventing command injection through malicious hostname patterns.

Detection Methods for CVE-2026-26331

Indicators of Compromise

  • Unusual URLs containing shell metacharacters (;, |, $(), backticks) being processed by yt-dlp
  • Unexpected child processes spawned by yt-dlp processes
  • Suspicious network connections originating from yt-dlp execution contexts
  • Presence of --netrc-cmd with placeholder ({}) in yt-dlp configurations or command history

Detection Strategies

  • Monitor process execution trees for yt-dlp spawning unexpected shell commands or child processes
  • Implement URL logging and analysis for yt-dlp invocations to identify malicious patterns
  • Create detection rules for command injection patterns in URL parameters passed to yt-dlp
  • Review HTTP redirect chains in network logs that lead to yt-dlp processing suspicious URLs

Monitoring Recommendations

  • Enable detailed logging for yt-dlp operations, particularly when --netrc-cmd is configured
  • Deploy endpoint detection rules to identify command injection attempts against media downloaders
  • Monitor for outbound network connections from processes that shouldn't be making external requests
  • Alert on yt-dlp configuration files containing netrc_cmd with placeholder patterns

How to Mitigate CVE-2026-26331

Immediate Actions Required

  • Upgrade yt-dlp to version 2026.02.21 or later immediately
  • Audit all systems and scripts using yt-dlp for --netrc-cmd or netrc_cmd usage
  • Review recent yt-dlp execution logs for any suspicious URL patterns
  • Temporarily disable --netrc-cmd functionality if immediate upgrade is not possible

Patch Information

The vulnerability is fixed in yt-dlp version 2026.02.21. The patch implements strict validation of all netrc "machine" values, limiting them to shell-safe characters and raising an error upon unexpected input. Users should upgrade to this version or later. The fix is available through the GitHub Release 2026.02.21. Additional technical details are available in the GitHub Security Advisory GHSA-g3gw-q23r-pgqm.

Workarounds

  • Remove the --netrc-cmd command-line option from all yt-dlp invocations and configurations
  • Avoid using the netrc_cmd parameter in Python scripts utilizing the yt-dlp library
  • If --netrc-cmd must be used, do not pass a placeholder ({}) in the argument
  • Consider using alternative authentication methods such as cookies or direct credential files
bash
# Configuration example
# Verify current yt-dlp version
yt-dlp --version

# Upgrade yt-dlp to the patched version
pip install --upgrade yt-dlp>=2026.02.21

# Alternative: If using system package manager (example for pip-based install)
python3 -m pip install --upgrade yt-dlp

# Check for --netrc-cmd usage in existing configurations
grep -r "netrc-cmd\|netrc_cmd" ~/.config/yt-dlp/ /etc/yt-dlp.conf 2>/dev/null

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechYt Dlp

  • SeverityHIGH

  • CVSS Score8.8

  • EPSS Probability0.60%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityHigh
  • AvailabilityHigh
  • CWE References
  • CWE-78
  • Technical References
  • GitHub Release 2026.02.21
  • Vendor Resources
  • GitHub Commit Update

  • GitHub Security Advisory GHSA-g3gw-q23r-pgqm
  • Related CVEs
  • CVE-2024-22423: Yt-dlp Command Injection RCE Vulnerability

  • CVE-2024-38519: yt-dlp Path Traversal Vulnerability
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English