Cloudanix VulnDB

CVE-2024-38519

High · 7.8

CVSS

7.8

EPSS

0.3%

Published

Jul 2, 2024

CISA due date

—

Cloudanix analysis

Next patch cycle SSVC: Track

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

  1. Attacker identifies or controls a media source that yt-dlp or youtube-dl will fetch
  2. Victim initiates a download using default or permissive output template without extension whitelist
  3. Malicious file with executable extension is written to working directory or user-specified path
  4. Tool loads configuration or Windows executes binary from the same directory on subsequent runs
  5. 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