CVE-2025-43858 YoutubeDLSharp allows command injection on windows system due to non sanitized arguments
Attackers can execute arbitrary commands on Windows systems via unsanitized arguments in the YoutubeDLSharp library.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2025-43858?
CVE-2025-43858 is a critical command injection vulnerability in Bluegrams YoutubeDLSharp, published on 24 Apr 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
YoutubeDLSharp is a wrapper for the command-line video downloaders youtube-dl and yt-dlp. In versions starting from 1.0.0-beta4 and prior to 1.1.2, an unsafe conversion of arguments allows the injection of a malicious commands when starting `yt-dlp` from a commands prompt running on Windows OS with the `UseWindowsEncodingWorkaround` value defined to true (default behavior). If a user is using built-in methods from the YoutubeDL.cs file, the value is true by default and a user cannot disable it from these methods. This issue has been patched in version 1.1.2.
Which versions are affected by CVE-2025-43858?
2 open source packages ship an affected version, including YoutubeDLSharp.
| Package | Affected | Fixed in |
|---|---|---|
YoutubeDLSharp NuGet | From 1.0.0-beta4 | 1.1.2 |
YoutubeDLSharp NuGet | From 1.0.0-beta4 | 1.1.2 |
How do I fix CVE-2025-43858?
Upgrade YoutubeDLSharp to 1.1.2 or later.
Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.
Is CVE-2025-43858 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-43858 exists.
Sources
Also known as GHSA-2jh5-g5ch-43q5.