Search covers the description text, product and vendor names and weakness types (also partial words).

CVE-2023-40581
yt-dlp project yt-dlp

Score7.8 High
CVSS 3.1
Exploit probability (EPSS)1.4%
within the next 30 days
CategoryCode execution & injection
Published25 September 2023
Last modified: 17 June 2026

In short

This vulnerability can be exploited with local access to the device, without logging in, if a user clicks a link, opens a file or similar.

A successful attack has high impact: reading confidential data, modifying data, crashing the system or making it unavailable.

Weakness type: OS command injection.

✨ AI commentary

After a short ad, a plain-language commentary on this vulnerability is shown. AI can make mistakes; base decisions on the official sources.

Official description

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.

CVSS: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Weakness: CWE-78 – OS command injection

Affected products

VendorProductVersions
yt-dlp projectyt-dlp>=2021.04.11 <2023.09.24

Sources

Latest in the same category

  • CVE-2026-139857 Low 2.1
    A vulnerability was detected in Dromara Jpom up to 2.11.14. The affected element is the function toIndex of the file modules/server/src/main/java/org/dromara/jpom/controller/IndexControl.java of the component Web…
    Code execution & injection · 30 November 2026
  • CVE-2026-139856 Medium 5.5
    A security vulnerability has been detected in Dromara Jpom up to 2.11.13. Impacted is the function listPage of the file BaseDbService.java. The manipulation of the argument order_field leads to sql injection. The…
    Code execution & injection · 30 November 2026
  • CVE-2026-137199 Critical 9.2
    cross-spawn is a cross-platform solution for Node.js spawn and spawnSync. Prior to 6.0.7 and 7.1.0, Windows applications that pass untrusted arguments to commands routed through cmd.exe can be vulnerable because…
    Code execution & injection · 30 November 2026
  • CVE-2026-137198 High 8.3
    cross-spawn is a cross-platform solution for Node.js spawn and spawnSync. From 6.0.6 until 6.0.7 and from 7.0.4 until 7.1.0, Windows applications that pass untrusted arguments to commands routed through cmd.exe can be…
    Code execution & injection · 30 November 2026
  • CVE-2026-137197 High 8.1
    cross-spawn is a cross-platform solution for Node.js spawn and spawnSync. Prior to 6.0.8 and 7.1.1, applications running on Windows that pass untrusted arguments can be vulnerable when a command sent through cmd.exe is…
    Code execution & injection · 30 November 2026
  • CVE-2026-137190 High 7
    Vite+ is a unified toolchain and entry point for web development. From 0.3.3 until 1.5.1, the global vp command line interface's vp env use path can place an unvalidated package-manager version from a…
    Code execution & injection · 30 November 2026