Home/CVE/yt-dlp is a youtube-dl fork with additional features and fixes. yt-dlp allows the user to provide shell command lines to
CVE

CVE-2023-40581

yt-dlp is a youtube-dl fork with additional features and fixes. yt-dlp allows the user to provide shell command lines to

yt-dlp is a youtube-dl fork with additional features and fixes. yt-dlp allows the user to provide shell command lines to be executed at various stages in its download steps through the --exec flag. This flag allows output template expansion in its argument, so that metadata values may be used in the shell commands. The metadata fields can be combined with the %q conversion, which is intended to quote/escape these values so they can be safely passed to the shell.

However, the escaping used for cmd (the shell used by Python's subprocess on Windows) does not properly escape special characters, which can allow for remote code execution if --exec is used directly with maliciously crafted remote data. This vulnerability only impacts yt-dlp on Windows, and the vulnerability is present regardless of whether yt-dlp is run from cmd or from PowerShell. Support for output template expansion in --exec, along with this vulnerable behavior, was added to yt-dlp in version 2021.04.11. yt-dlp version 2023.09.24 fixes this issue by properly escaping each special character. \n will be replaced by \r as no way of escaping it has been found.

It is recommended to upgrade yt-dlp to version 2023.09.24 as soon as possible. Also, always be careful when using --exec, because while this specific vulnerability has been patched, using unvalidated input in shell commands is inherently dangerous. For Windows users who are not able to upgrade: 1.

Avoid using any output template expansion in --exec other than {} (filepath). 2. If expansion in --exec is needed, verify the fields you are using do not contain ", | or &. 3. Instead of using --exec, write the info json and load the fields from it instead.

HIGH · CVSS 8.3 EPSS 0.12983
Act now
  • EPSS ≥ 0.10 - elevated exploitation probability
  • EPSS percentile: top 6% of all CVEs by exploitation likelihood
  • Public exploit or PoC is available
  • CVSS base score ≥ 7.0
Sigma rules7 YARA rules0

Affected Products & Versions

1
yt-dlp project yt-dlp>= 2021.04.11 and < 2023.09.24

Affected Packages

1
Language-ecosystem packages (from OSV) tied to this CVE, with the version that fixes it - the dependency-level detail NVD doesn’t carry.
PyPI yt-dlp HIGH fixed in 2023.09.24

Public Exploits & PoCs

1

Sigma Hunt Rules

7
Exact rules name this CVE ID. Product rules name an affected product in their title. Related rules cover techniques used by actors who exploited this CVE. Showing the most relevant matches; the complete related set is on the full drill-down.
productcriticalHackTool - Windows Credential Editor (WCE) Execution
productcriticalWindows Credential Editor Registry
producthighOpenCanary - MSSQL Login Attempt Via Windows Authentication
producthighWindows LAPS Credential Dump From Entra ID
producthighTamper Windows Defender - PSClassic
producthighTamper Windows Defender Remove-MpPreference - ScriptBlockLogging

Scoring & Timeline

8.3
HIGH · CVSS v3.1 · security-advisories@github.com
View on NVD
Attack Vector
Network Adjacent Local Physical
Attack Complexity
Low High
Privileges Required
None Low High
User Interaction
None Required
Scope
Unchanged Changed
Confidentiality
None Low High
Integrity
None Low High
Availability
None Low High
Published to NVD25 Sep 2023 · 07:15 PM
CVSS VectorCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H

Vendor Advisories

1
suse-csafopenSUSE-SU-2024:13854-1
🔗

References & Sources

4
Source URLs (vendor pages, mailing lists, write-ups). Exploit/PoC links are in their own section above to avoid duplication.
Intelligence Graph · click any node to traverse
CVETechnique ActorTool Family
drag to reposition · click any node to traverse · button top-right enlarges
External lookups - second-class, for what we don’t hold ourselves
Vulnerabilities
CISA KEV catalog
CWE weaknesses
CAPEC attack patterns
Package vulnerabilities
Threat intelligence
Threat actors
Tools & malware
ATT&CK techniques
IOCs
Detection & defense
Sigma rules
YARA rules
Atomic Red Team tests
D3FEND countermeasures
Compliance
NIST 800-53
ISO 27001:2022
SOC 2 TSC
PCI-DSS v4.0
CIS Controls v8.1
About
All capabilities
Live statistics
Data sources
Privacy policy
Terms of service
threatengine.sh  ·  Open-source threat intelligence platform  ·  100+ authoritative sources  ·  Every fact traces to its origin