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 productsnot 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
References
-
github.com
/yt-dlp/yt-dlp/commit/5ce582448ececb8d9c30c8c31f58330090ced03a
web, patch
-
github.com
/ytdl-org/youtube-dl/pull/32830
web
-
github.com
/ytdl-org/youtube-dl/commit/d42a222ed541b96649396ef00e19552aef0f09ec
web
-
github.com
/yt-dlp/yt-dlp/security/advisories/GHSA-79w7-vh3h-8g4j
web
-
github.com
/yt-dlp/yt-dlp/releases/tag/2024.07.01
web
-
securitylab.github.com
/advisories/GHSL-2024-090_yt-dlp
advisory
-
github.com
/dirkf/youtube-dl/security/advisories/GHSA-22fp-mf44-f2mq
web
- securitylab.github.com /advisories/GHSL-2024-089_youtube-dl/
-
nvd.nist.gov
/vuln/detail/CVE-2024-38519
advisory
-
github.com
/yt-dlp/yt-dlp
package
-
securitylab.github.com
/advisories/GHSL-2024-089_youtube-dl
advisory
-
pypi.org
/project/yt-dlp
package
-
github.com
/advisories/GHSA-79w7-vh3h-8g4j
advisory
Sources
- CVE List CVE-2024-38519
- GitHub Advisory GHSA-79w7-vh3h-8g4j
- NVD CVE-2024-38519
- OSV PYSEC-2026-2065
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.