Skip to content
Fencer Vulns
high 7.8

CVE-2024-38519 json

yt-dlp and youtube-dl vulnerable to file system modification and RCE through improper file-extension sanitization

published 2024-07-02 2 y ago modified 2026-07-07 4 mo ago also EUVD-2024-2285 , GHSA-79w7-vh3h-8g4j , PYSEC-2026-2065

cvss
7.8
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.3%
EPSS 0.3% chance of exploitation in 30 days, percentile 25%
public exploits
0
none known

Summary

`yt-dlp` and `youtube-dl` are command-line audio/video downloaders. Prior to the fixed versions, `yt-dlp` and `youtube-dl` do not limit the extensions of downloaded files, which could lead to arbitrary filenames being created in the download folder (and path traversal on Windows). Since `yt-dlp` and `youtube-dl` also read config from the working directory (and on Windows executables will be executed from the `yt-dlp` or `youtube-dl` directory), this could lead to arbitrary code being executed.

`yt-dlp` version 2024.07.01 fixes this issue by whitelisting the allowed extensions. `youtube-dl` fixes this issue in commit `d42a222` on the `master` branch and in nightly builds tagged 2024-07-03 or later. This might mean some very uncommon extensions might not get downloaded, however it will also limit the possible exploitation surface. In addition to upgrading, have `.%(ext)s` at the end of the output template and make sure the user trusts the websites that they are downloading from. Also, make sure to never download to a directory within PATH or other sensitive locations like one's user directory, `system32`, or other binaries locations. For users who are not able to upgrade, keep the default output template (`-o "%(title)s [%(id)s].%(ext)s`); make sure the extension of the media to download is a common video/audio/sub/... one; try to avoid the generic extractor; and/or use `--ignore-config --config-location ...` to not load config from common locations.

Patch / fix

  • pypi yt-dlp 2024.07.01
  • yt-dlp yt-dlp 2024.07.01
  • ytdl-org youtube-dl 2024-07-03, d42a222
  • yt-dlp_project yt-dlp 2024.07.01
  • yt-dlp Debian 14, Debian 13 2024.07.01-1

debian advisories DEBIAN-CVE-2024-38519

  • yt-dlp openSUSE Tumbleweed 2024.07.01-1.1

opensuse advisories openSUSE-SU-2024:14094-1

  • yt-dlp Alpine 3.24, Alpine 3.23, Alpine 3.22 +1 more 2024.07.01-r0

alpine advisories ALPINE-CVE-2024-38519

Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2024-38519 updated cvss 7.8

yt-dlp: File system modification and RCE through improper file-extension sanitization

  • Red Hat All currently supported Red Hat products
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

CISA SSVC

Exploitation
Proof of concept is public
Automatable
no
Technical impact
total
Assessed
2 y ago

Exploit prediction

0.33% chance of exploitation in the next 30 days, higher than 25% of all scored CVEs (FIRST EPSS, 2026-11-08).

CVSS scores

assigned by version score vector
CNA 3.1 7.8 CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
GitHub 3.1 7.8 CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
OSV 3.1 7.8 CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Affected packages

ecosystem package affected fixed in
pypi yt-dlp
<2024.07.01
2024.07.01

Affected products

  • yt-dlp yt-dlp
  • ytdl-org youtube-dl
  • yt-dlp_project yt-dlp

Classification

Weakness
  • CWE-669 Incorrect Resource Transfer Between Spheres
  • CWE-434 Unrestricted Upload of File with Dangerous Type

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.

CPEs and fixed versions use Anchore's correction of NVD's data: Added CPE configurations because not yet analyzed by NVD.