CVE-2024-22423 Affecting yt-dlp package, versions <0-r0


Severity

Recommended
low

Based on default assessment until relevant scores are available.

Threat Intelligence

EPSS
0.05% (18th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-ALPINE321-YTDLP-8490306
  • published6 Dec 2024
  • disclosed9 Apr 2024

Introduced: 9 Apr 2024

CVE-2024-22423  (opens in a new tab)

How to fix?

Upgrade Alpine:3.21 yt-dlp to version 0-r0 or higher.

NVD Description

Note: Versions mentioned in the description apply only to the upstream yt-dlp package and not the yt-dlp package as distributed by Alpine. See How to fix? for Alpine:3.21 relevant fixed versions and status.

yt-dlp is a youtube-dl fork with additional features and fixes. The patch that addressed CVE-2023-40581 attempted to prevent RCE when using --exec with %q by replacing double quotes with two double quotes. However, this escaping is not sufficient, and still allows expansion of environment variables. 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 2024.04.09 fixes this issue by properly escaping %. It replaces them with %%cd:~,%, a variable that expands to nothing, leaving only the leading percent. It is recommended to upgrade yt-dlp to version 2024.04.09 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, avoid using any output template expansion in --exec other than {} (filepath); if expansion in --exec is needed, verify the fields you are using do not contain &#34;, | or &amp;; and/or instead of using --exec, write the info json and load the fields from it instead.