CVE-2025-43858
YoutubeDLSharp allows command injection on windows system due to non sanitized arguments
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.
Attack profile
How easy it is to exploit
- Attack vector
- Local
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
9.2
YoutubeDLSharp allows command injection on windows system due to non sanitized arguments
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.
- Record
CVE-2025-43858- CVSS 3.1
- 9.2 Critical
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:L - Weakness
- CWE-77, CWE-78
- Updated
- 2026-11-02
EUVDEUVD-2025-11986
9.2
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.
- Record
EUVD-2025-11986- CVSS 3.1
- 9.2 Critical
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:L - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-2jh5-g5ch-43q5
9.2
YoutubeDLSharp allows command injection on windows system due to non sanitized arguments
Summary
This vulnerability only apply when running on a Windows OS.
An unsafe conversion of arguments allows the injection of a malicous commands when starting yt-dlp from a commands prompt.
[!CAUTION] NOTE THAT DEPENDING ON THE CONTEXT AND WHERE THE LIBRARY IS USED, THIS MAY HAVE MORE SEVERE CONSEQUENCES. FOR EXAMPLE, A USER USING THE LIBRARY LOCALLY IS A LOT LESS VULNERABLE THAN AN ASP.NET APPLICATION ACCEPTING INPUTS FROM A NETWORK/INTERNET.
Details
The vulnerability have been implemented in a commit (https://github.com/Bluegrams/YoutubeDLSharp/commit/fdf3256da18d0e2da4a2f33ad4a1b72ff8273a50) 3 year ago to fix a issue with unicode characters on Windows. ( In the latest version at the time of writing this, the code seems to have moved here : https://github.com/Bluegrams/YoutubeDLSharp/blob/b2f7968a2ef06a9c7b2c212785cfeac0b187b6d8/YoutubeDLSharp/YoutubeDLProcess.cs#L87 ) In this commit, a new way of starting yt-dlp was implemented, method that was defined as the default behaviour.
When the internal method ConvertToArgs get called, the application will test multiples conditions to decide on how the yt-dlp application should be started. The condition we are interesed in, as well a the default one on Windows, is at line 99 . Inside the if statement, we can see that insead of directly calling the yt-dlp binary, a command prompt is opened to run yt-dlp.
The problem arises when you realize that both arguments in the ConvertToArgs method may be provided by an untrusted client. Since the documentation of YoutubeDLSharp does not warn developers about this behavior, they might assume that the library handles this safely by ensuring that the arguments are secure to run inside a command prompt. Instead, the two potentially malicious arguments are directly appended to the command string without any sanitization (see line 104 and 107).
PoC
For this example, I'm going to use the version 1.1.1 and a method inside YoutubeDL.cs. Assuming you are running on a Windows OS, this method will by default use a CMD to open yt-dlp.
using YoutubeDLSharp;
public async Task<RunResult<VideoData>> GetMediaInformation()
{
YoutubeDL youtubeDl = new YoutubeDL();
// Fetch media information using a badly crafted "url" (escaped)
return await youtubeDl.RunVideoDataFetch("https://example.com/\" & start calc.exe");
}
At the call of GetMediaInformation, the method RunVideoDataFetch will be called, internally this method will call the vulnerable method [ConvertToArgs] resulting in the following string:
/C chcp 65001 >nul 2>&1 && "yt-dlp.exe" --external-downloader "m3u8:native" --external-downloader-args "ffmpeg:-nostats -loglevel 0" -o "C:\Users\<hidden>\Documents\GitHub\<hidden>\<hidden>\bin\Release\net8.0\%(title)s [%(id)s]_%(epoch)s.%(ext)s" --force-overwrites --no-part -i --ignore-config --ffmpeg-location "ffmpeg.exe" --exec "echo outfile: {}" -- "https://example.com/" & start calc.exe"
[!NOTE] Some text have been replaced by
<hidden>inside the command.
The important part here is at the end of the command, we can see "https://example.com/" & start calc.exe", if we compare it with our …
- Record
GHSA-2jh5-g5ch-43q5- CVSS 3.1
- 9.2 Critical
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:L - Weakness
- CWE-77, CWE-78
- Updated
- 2026-11-02
NVD
9.2
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.
- Record
CVE-2025-43858- CVSS 3.1
- 9.2 Critical
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:L - Weakness
- CWE-77, CWE-78
- Updated
- 2026-11-02
OSV
9.2
YoutubeDLSharp allows command injection on windows system due to non sanitized arguments
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.
- Record
CVE-2025-43858- CVSS 3.1
- 9.2 Critical
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:L - Weakness
- CWE-77, CWE-78
- Updated
- 2026-11-02
OSVGHSA-2jh5-g5ch-43q5
9.2
YoutubeDLSharp allows command injection on windows system due to non sanitized arguments
Summary
This vulnerability only apply when running on a Windows OS.
An unsafe conversion of arguments allows the injection of a malicous commands when starting yt-dlp from a commands prompt.
[!CAUTION] NOTE THAT DEPENDING ON THE CONTEXT AND WHERE THE LIBRARY IS USED, THIS MAY HAVE MORE SEVERE CONSEQUENCES. FOR EXAMPLE, A USER USING THE LIBRARY LOCALLY IS A LOT LESS VULNERABLE THAN AN ASP.NET APPLICATION ACCEPTING INPUTS FROM A NETWORK/INTERNET.
Details
The vulnerability have been implemented in a commit (https://github.com/Bluegrams/YoutubeDLSharp/commit/fdf3256da18d0e2da4a2f33ad4a1b72ff8273a50) 3 year ago to fix a issue with unicode characters on Windows. ( In the latest version at the time of writing this, the code seems to have moved here : https://github.com/Bluegrams/YoutubeDLSharp/blob/b2f7968a2ef06a9c7b2c212785cfeac0b187b6d8/YoutubeDLSharp/YoutubeDLProcess.cs#L87 ) In this commit, a new way of starting yt-dlp was implemented, method that was defined as the default behaviour.
When the internal method ConvertToArgs get called, the application will test multiples conditions to decide on how the yt-dlp application should be started. The condition we are interesed in, as well a the default one on Windows, is at line 99 . Inside the if statement, we can see that insead of directly calling the yt-dlp binary, a command prompt is opened to run yt-dlp.
The problem arises when you realize that both arguments in the ConvertToArgs method may be provided by an untrusted client. Since the documentation of YoutubeDLSharp does not warn developers about this behavior, they might assume that the library handles this safely by ensuring that the arguments are secure to run inside a command prompt. Instead, the two potentially malicious arguments are directly appended to the command string without any sanitization (see line 104 and 107).
PoC
For this example, I'm going to use the version 1.1.1 and a method inside YoutubeDL.cs. Assuming you are running on a Windows OS, this method will by default use a CMD to open yt-dlp.
using YoutubeDLSharp;
public async Task<RunResult<VideoData>> GetMediaInformation()
{
YoutubeDL youtubeDl = new YoutubeDL();
// Fetch media information using a badly crafted "url" (escaped)
return await youtubeDl.RunVideoDataFetch("https://example.com/\" & start calc.exe");
}
At the call of GetMediaInformation, the method RunVideoDataFetch will be called, internally this method will call the vulnerable method [ConvertToArgs] resulting in the following string:
/C chcp 65001 >nul 2>&1 && "yt-dlp.exe" --external-downloader "m3u8:native" --external-downloader-args "ffmpeg:-nostats -loglevel 0" -o "C:\Users\<hidden>\Documents\GitHub\<hidden>\<hidden>\bin\Release\net8.0\%(title)s [%(id)s]_%(epoch)s.%(ext)s" --force-overwrites --no-part -i --ignore-config --ffmpeg-location "ffmpeg.exe" --exec "echo outfile: {}" -- "https://example.com/" & start calc.exe"
[!NOTE] Some text have been replaced by
<hidden>inside the command.
The important part here is at the end of the command, we can see "https://example.com/" & start calc.exe", if we compare it with our …
- Record
GHSA-2jh5-g5ch-43q5- CVSS 3.1
- 9.2 Critical
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:L - Weakness
- CWE-77, CWE-78
- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
YoutubeDLSharpNuGet |
1.0.0-beta4 up to 1.1.2 | 1.1.2 |
YoutubeDLSharpNuGet |
1.0.0-beta4 up to 1.1.2, plus listed versions 1.0.01.0.0-beta51.0.0-beta61.1.01.1.1 |
1.1.2 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2025-43858 is a critical vulnerability (CVSS 9.2) in Bluegrams Youtubedlsharp, published April 23, 2025. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.26%, the 18th percentile. Fixed in YoutubeDLSharp 1.1.2.
References
github.com/Bluegrams/YoutubeDLSharp/security/advisories/GHSA-2jh5-g5ch-43q5
github.com/Bluegrams/YoutubeDLSharp/commit/b6051372bd5af30f95f73de47d9bc71c3a07de0f
github.com/Bluegrams/YoutubeDLSharp/commit/fdf3256da18d0e2da4a2f33ad4a1b72ff8273a50
nvd.nist.gov/vuln/detail/CVE-2025-43858
github.com/advisories/GHSA-2jh5-g5ch-43q5
github.com/CVEProject/cvelistV5/tree/main/cves/2025/43xxx/CVE-2025-43858.json
github.com/Bluegrams/YoutubeDLSharp
Left out here: the rest of 2 source descriptions. The JSON record has them.