Miggo Logo

CVE-2025-43858:
YoutubeDLSharp allows command injection on windows system due to non sanitized arguments

9.2

CVSS Score
3.1

Basic Information

EPSS Score
0.05953%
Published
4/23/2025
Updated
4/24/2025
KEV Status
No
Technology
TechnologyC#

Technical Details

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:L
Package NameEcosystemVulnerable VersionsFirst Patched Version
YoutubeDLSharpnuget>= 1.0.0-beta4, < 1.1.21.1.2

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability lies in the improper construction and execution of a command string via cmd.exe when the UseWindowsEncodingWorkaround is enabled (default on Windows).

  1. YoutubeDLSharp.YoutubeDLProcess.RunAsync is the core vulnerable function as it contains the logic that prepares and executes the cmd.exe command. It concatenates user-controlled input (obtained from ConvertToArgs) into this command without sanitization. The introducing commit fdf3256da18d0e2da4a2f33ad4a1b72ff8273a50 added this vulnerable execution path, and the patching commit b6051372bd5af30f95f73de47d9bc71c3a07de0f removed it.
  2. YoutubeDLSharp.YoutubeDLProcess.ConvertToArgs is critical because it processes the raw urls and options that can be malicious. Its output is directly fed into the vulnerable command construction in RunAsync. The vulnerability description explicitly mentions that arguments to this method can come from untrusted clients.
  3. YoutubeDLSharp.YoutubeDL.RunVideoDataFetch is identified from the PoC as a public-facing method that accepts the malicious URL. It acts as an entry point, passing the tainted data into the vulnerable backend processing. The vulnerability description confirms that methods in YoutubeDL.cs use the vulnerable workaround by default. These functions would likely appear in a runtime profile during exploitation, with RunVideoDataFetch (or similar public methods) initiating the call, ConvertToArgs processing the input, and RunAsync executing the injected command.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

## Summ*ry T*is vuln*r**ility only *pply w**n runnin* on * Win*ows OS. *n uns*** *onv*rsion o* *r*um*nts *llows t** inj**tion o* * m*li*ous *omm*n*s w**n st*rtin* `yt-*lp` *rom * *omm*n*s prompt. > [!**UTION] > **NOT* T**T **P*N*IN* ON T** *ONT*XT *

Reasoning

T** vuln*r**ility li*s in t** improp*r *onstru*tion *n* *x**ution o* * *omm*n* strin* vi* `*m*.*x*` w**n t** `Us*Win*ows*n*o*in*Work*roun*` is *n**l** (****ult on Win*ows). *. `Youtu***LS**rp.Youtu***LPro**ss.Run*syn*` is t** *or* vuln*r**l* *un*tio