CVE-2024-38519

CVE-2024-38519 is a high-severity unrestricted upload of dangerous file types vulnerability in yt-dlp (pip), affecting versions < 2024.07.01. It is fixed in 2024.07.01.

Summary

yt-dlp does 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 also reads config from the working directory (and on Windows executables will be executed from the yt-dlp directory) this could lead to arbitrary code being executed.

Workarounds

It is recommended to upgrade yt-dlp to version 2024.07.01 as soon as possible, always have .%(ext)s at the end of the output template, and make sure you trust the websites that you are downloading from. Also, make sure to never download to a directory within PATH or other sensitive locations like your user directory, system32, or other binaries locations.

For users not able to upgrade:

  • Make sure the extension of the media to download is a common video/audio/sub/... one
  • Try to avoid the generic extractor (--ies default,-generic)
  • Keep the default output template (-o "%(title)s [%(id)s].%(ext)s)
  • Omit any of the subtitle options (--write-subs, --write-auto-subs, --all-subs, --write-srt)
  • Use --ignore-config --config-location ... to not load config from common locations

Details

One potential exploitation might look like this:

From a mimetype we do not know, we default to trimming the leading bit and using the remainder. Given a webpage that contains

<script type="application/ld+json">
{
    "@context": "https://schema.org",
    "@type": "VideoObject",
    "name": "ffmpeg",
    "encodingFormat": "video/exe",
    "contentUrl": "https://example.com/video.mp4"
}
</script>

this will try and download a file called ffmpeg.exe (-o "%(title)s.%(ext)s).
ffmpeg.exe will be searched for in the current directory, and so upon the next run arbitrary code can be executed.

Alternatively, when engineering a file called yt-dlp.conf to be created, the config file could contain --exec ... and so would also execute arbitrary code.

Acknowledgement

A big thanks to @JarLob for independently finding a new application of the same underlying issue.
More can be read about on the dedicated GitHub Security Lab disclosure here: Path traversal saving subtitles (GHSL-2024-090)

References

Impact

The application accepts file uploads without adequately restricting the file type or content. Typical impact: remote code execution if the uploaded file can be served and executed on the server.

CVE-2024-38519 has a CVSS score of 7.8 (High). The vector is requires local access, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2024.07.01); upgrading removes the vulnerable code path.

Affected versions

yt-dlp (< 2024.07.01)

Security releases

yt-dlp → 2024.07.01 (pip)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

yt-dlp version 2024.07.01 fixes this issue by whitelisting the allowed extensions.
This means some very uncommon extensions might not get downloaded; however, it will also limit the possible exploitation surface.

Frequently Asked Questions

  1. What is CVE-2024-38519? CVE-2024-38519 is a high-severity unrestricted upload of dangerous file types vulnerability in yt-dlp (pip), affecting versions < 2024.07.01. It is fixed in 2024.07.01. The application accepts file uploads without adequately restricting the file type or content.
  2. How severe is CVE-2024-38519? CVE-2024-38519 has a CVSS score of 7.8 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of yt-dlp are affected by CVE-2024-38519? yt-dlp (pip) versions < 2024.07.01 is affected.
  4. Is there a fix for CVE-2024-38519? Yes. CVE-2024-38519 is fixed in 2024.07.01. Upgrade to this version or later.
  5. Is CVE-2024-38519 exploitable, and should I be worried? Whether CVE-2024-38519 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2024-38519 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2024-38519? Upgrade yt-dlp to 2024.07.01 or later.

Other vulnerabilities in yt-dlp

CVE-2026-50574CVE-2026-50023CVE-2026-50019CVE-2024-38519CVE-2024-22423

Stop the waste.
Protect your environment with Kodem.