CVE-2024-38519
High · 7.8CVSS
7.8
EPSS
0.3%
Published
Jul 2, 2024
CISA due date
—
Cloudanix analysis
A popular video downloading program could let attackers run harmful programs on your computer by saving files with bad names that the program then loads automatically.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Application
- Class
- Path Traversal
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The flaw permits unrestricted file extensions during downloads, enabling arbitrary filenames including path traversal on Windows; combined with config loading from the working directory and execution of binaries from that location, this allows arbitrary code execution.
Why it matters to the business
Attackers can execute malicious code on systems running affected download tools, potentially leading to data theft, ransomware deployment, or full system compromise, especially in environments with high usage of media download utilities across Debian Linux deployments.
How an attack unfolds
An attacker crafts a malicious download link or uses a compromised site to deliver a file with a dangerous extension such as .exe or .bat; the tool saves it without sanitization into the download or working directory, after which the tool or system loads and executes the file as config or a binary on next invocation or launch from that path.
How to fix it
Upgrade yt-dlp to version 2024.07.01 or later on all platforms; for youtube-dl apply commit d42a222 or use nightly builds from 2024-07-03 onward; on Debian 12 use package version 6.1.90-1 or newer and on Debian 13 use 6.8.9-1 or newer; enforce output templates ending in .%(ext)s; avoid downloading to PATH directories or user homes; use --ignore-config when necessary.
How to confirm the fix worked
Verify installed package versions against the fixed releases listed for Debian 12 and 13; test downloads with non-whitelisted extensions to confirm they are rejected; review output templates in configuration files to ensure .%(ext)s suffix is present.
Typical attack path
- Attacker identifies or controls a media source that yt-dlp or youtube-dl will fetch
- Victim initiates a download using default or permissive output template without extension whitelist
- Malicious file with executable extension is written to working directory or user-specified path
- Tool loads configuration or Windows executes binary from the same directory on subsequent runs
- Arbitrary code executes with the privileges of the user running the downloader
How to detect it
Search process execution logs and file creation events in download directories for unexpected executable extensions; review shell history and config files loaded from working directories for anomalous entries; examine Windows prefetch or Linux audit logs for binaries launched from yt-dlp or youtube-dl directories shortly after downloads.
What your security team should do
- Immediately update all yt-dlp and youtube-dl installations to the fixed versions provided for Debian 12 and 13
- Audit and restrict output templates and working directories used by download tools
- Block downloads from untrusted domains and enforce --ignore-config in automated scripts
- Monitor for any post-publication exploitation attempts given the stable EPSS and widespread media tool usage
The record
`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 packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| PyPI | youtube-dl | 2015.01.25 | No fix |
| PyPI | yt-dlp | 0 | 2024.07.01 |
| Debian:11 | youtube-dl | 0 | No fix |
| Debian:12 | youtube-dl | 0 | No fix |
| Debian:12 | yt-dlp | 0 | No fix |
| Debian:13 | yt-dlp | 0 | 2024.07.01-1 |
| Debian:14 | yt-dlp | 0 | 2024.07.01-1 |
| Ubuntu:22.04:LTS | yt-dlp | 0 | No fix |
| Ubuntu:24.04:LTS | yt-dlp | 0 | No fix |
| Ubuntu:24.10 | yt-dlp | 0 | No fix |
| Ubuntu:25.04 | yt-dlp | 0 | No fix |
| Ubuntu:25.10 | yt-dlp | 0 | No fix |
| openSUSE:Tumbleweed | yt-dlp | 0 | 2024.07.01-1.1 |
| pypi | youtube-dl | 2015.01.25 | No fix |
Related vulnerabilities
- CVE-2026-26331 yt-dlp is a command-line audio/video downloader. Also affects yt-dlp
- GHSA-g3gw-q23r-pgqm yt-dlp: Arbitrary Command Injection when using the `--netrc-cmd` option Also affects yt-dlp
- HSEC-2024-0003 process: command injection via argument list on Windows Also affects yt-dlp
- CVE-2026-50023 yt-dlp is a command-line audio/video downloader. Also affects yt-dlp
- CVE-2026-50574 yt-dlp is a command-line audio/video downloader. Also affects yt-dlp
- CVE-2026-50019 yt-dlp is a command-line audio/video downloader. Also affects yt-dlp
- CVE-2026-114722 Roundcube Webmail before 1.6.20 and 1.7.x before 1.7.5 is affected by a CSS scoping… CWE-669
- CVE-2026-106555 In sshd in OpenSSH before 10.6, GSSAPIAuthentication authentication state can incorrectly… CWE-669