CVE-2024-38519
yt-dlp and youtube-dl vulnerable to file system modification and RCE through improper file-extension sanitization
Also known as GHSA-79w7-vh3h-8g4j, PYSEC-2026-2065
Mitigation
- Upgrade yt-dlp to 2024.07.01 or later.
Who should check
- Projects that depend on PyPI package yt-dlp (< 2024.07.01)
- Anyone running yt-dlp >= < 2024.07.01, < 2024.07.01
- Anyone running ytdl-org youtube-dl >= >= 2015.01.25, <= 2021.12.17; >= nightly, < 2024-07-03
Vulnerability facts
- Affected
- yt-dlp < 2024.07.01
- Fixed in
- 2024.07.01
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Not remotely exploitable (local or adjacent access needed)
- CVSS
- 7.8 (v3.1, CNA)CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Local
- Attack complexity: Low
- Privileges required: None
- User interaction: Required
- Scope: Unchanged
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: High
- EPSS
- 0.40% chance of exploitation in 30 days (percentile 26, 2026-11-26)
- CWE
- CWE-669
- Modified
Description
`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.
Affected and fixed versions
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2024-38519. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2024-38519.md Affected: yt-dlp < 2024.07.01 Fixed in: 2024.07.01 Steps: 1. Search this machine and project for yt-dlp (PyPI), yt-dlp, ytdl-org youtube-dl: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
- https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-79w7-vh3h-8g4j
- https://securitylab.github.com/advisories/GHSL-2024-090_yt-dlp
- https://github.com/dirkf/youtube-dl/security/advisories/GHSA-22fp-mf44-f2mq
- https://nvd.nist.gov/vuln/detail/CVE-2024-38519
- https://securitylab.github.com/advisories/GHSL-2024-089_youtube-dl
- https://github.com/advisories/GHSA-79w7-vh3h-8g4j
Patches
FAQ
Is CVE-2024-38519 being exploited?
There is no confirmed exploitation: CVE-2024-38519 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.40% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2024-38519?
High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). A user has to take an action, such as opening a link, for the attack to work.
Which versions are affected by CVE-2024-38519?
yt-dlp < 2024.07.01.
Is there a fix for CVE-2024-38519?
Yes. Fixed in 2024.07.01. Upgrade yt-dlp to 2024.07.01 or later.
How do I check if I'm affected by CVE-2024-38519?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.