yt-dlp and youtube-dl vulnerable to file system modification and RCE through improper file-extension sanitization
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-434.
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| yt-dlp | yt-dlp | < 2024.07.01 to before 2024.07.01 | 2024.07.01 | Patch available | CNA |
| ytdl-org | youtube-dl | >= 2015.01.25 – 2021.12.17; nightly to before 2024-07-03 | 2024-07-03 | Patch available | CNA |
| — | yt-dlp (PyPI) | before 2024.07.01 | 2024.07.01 | Patch available | GHSA-79w7-vh3h-8g4j |
- yt-dlp Vendoryt-dlp Affected < 2024.07.01 to before 2024.07.01 Fixed in 2024.07.01 Patch available CNA
- youtube-dl Vendorytdl-org Affected >= 2015.01.25 – 2021.12.17; nightly to before 2024-07-03 Fixed in 2024-07-03 Patch available CNA
- yt-dlp (PyPI) Vendor— Affected before 2024.07.01 Fixed in 2024.07.01 Patch available GHSA-79w7-vh3h-8g4j
Remediation
- Fix · CNA yt-dlp (yt-dlp) Fixed in 2024.07.01
- Fix · CNA youtube-dl (ytdl-org) Fixed in 2024-07-03
- Fix · GHSA-79w7-vh3h-8g4j yt-dlp (PyPI) Fixed in 2024.07.01 Advisory →
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2024-38519
- 2026-10-03 Alias added: GHSA-79w7-vh3h-8g4j
References
Advisory 3
Other 8
- https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-79w7-vh3h-8g4j
- https://github.com/yt-dlp/yt-dlp/commit/5ce582448ececb8d9c30c8c31f58330090ced03a
- https://github.com/yt-dlp/yt-dlp/releases/tag/2024.07.01
- https://github.com/dirkf/youtube-dl/security/advisories/GHSA-22fp-mf44-f2mq
- https://securitylab.github.com/advisories/GHSL-2024-089_youtube-dl/
- https://github.com/ytdl-org/youtube-dl/pull/32830
- https://github.com/ytdl-org/youtube-dl/commit/d42a222ed541b96649396ef00e19552aef0f09ec
- https://github.com/yt-dlp/yt-dlp
More yt-dlp vulnerabilities
- TI-2024-03325 Command injection vulnerability in programing languages on Microsoft Windows operating system. CVSS 3.1CRITICAL 9.8
- TI-2026-36849 yt-dlp: Dangerous file type creation via insufficient filename sanitization (Bypass of CVE-2024-38519) CVSS 3.1CRITICAL 9.6
- TI-2025-33915 yt-dlp allows `--exec` command injection when using placeholder on Windows CVSS 3.1HIGH 8.1
- TI-2024-14996 yt-dlp `--exec` command injection when using `%q` in yt-dlp on Windows CVSS 3.1CRITICAL 9.8
- TI-2026-21287 yt-dlp: Arbitrary Command Injection when using the `--netrc-cmd` option CVSS 3.1HIGH 8.8
- TI-2026-37295 yt-dlp: Arbitrary code execution via manifest downloads with aria2c CVSS 3.1CRITICAL 9.6
Sources
- CVE-2024-38519 · CVE Program
- CVE-2024-38519 · NVD
- FIRST EPSS
- GHSA-79w7-vh3h-8g4j · GitHub Advisory Database · CC BY 4.0
- CVE-2024-38519 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences