Every CVE Search/ Get API key

CVE-2024-38519

yt-dlp and youtube-dl vulnerable to file system modification and RCE through improper file-extension sanitization

7.8 HighFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Local
Complexity
Low
Privileges needed
None
User interaction
Required

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
High

Exploit likelihood

0.33%Up 0.3 points since Jul 3, 2024
90%50%10%1%

What each source reports

CVE List Score used 7.8

yt-dlp and youtube-dl vulnerable to file system modification and RCE through improper file-extension sanitization

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.

Record
CVE-2024-38519
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Weakness
CWE-669
Updated
2026-11-02
EUVDEUVD-2024-2285 7.8

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.

Record
EUVD-2024-2285
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Updated
2026-11-03
GitHub AdvisoriesGHSA-79w7-vh3h-8g4j 7.8

yt-dlp File system modification and RCE through improper file-extension sanitization

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.

Patches

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.

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

Record
GHSA-79w7-vh3h-8g4j
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Weakness
CWE-434, CWE-669
Updated
2026-11-02
NVD 7.8

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.

Record
CVE-2024-38519
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Weakness
CWE-669
Updated
2026-11-02
OSVALPINE-CVE-2024-38519 7.8

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.

Record
ALPINE-CVE-2024-38519
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Updated
2026-11-03
OSV 7.8

yt-dlp and youtube-dl vulnerable to file system modification and RCE through improper file-extension sanitization

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.

Record
CVE-2024-38519
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Weakness
CWE-669
Updated
2026-11-02
Show 5 moreShow less
OSVDEBIAN-CVE-2024-38519 7.8

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.

Record
DEBIAN-CVE-2024-38519
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVGHSA-79w7-vh3h-8g4j 7.8

yt-dlp File system modification and RCE through improper file-extension sanitization

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.

Patches

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.

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

Record
GHSA-79w7-vh3h-8g4j
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Weakness
CWE-434, CWE-669
Updated
2026-11-02
OSVPYSEC-2026-2065 7.8

yt-dlp File system modification and RCE through improper file-extension sanitization

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.

Patches

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.

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

Record
PYSEC-2026-2065
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVUBUNTU-CVE-2024-38519 7.8

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.

Record
UBUNTU-CVE-2024-38519
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVopenSUSE-SU-2024:14094-1 No score

python310-yt-dlp-2024.07.01-1.1 on GA media

These are all security issues fixed in the python310-yt-dlp-2024.07.01-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:14094-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
yt-dlp
PyPI
before 2024.07.01
2024.07.01
yt-dlp
Alpine:v3.21
before 2024.07.01-r0
2024.07.01-r0
yt-dlp
Alpine:v3.22
before 2024.07.01-r0
2024.07.01-r0
yt-dlp
Alpine:v3.23
before 2024.07.01-r0
2024.07.01-r0
yt-dlp
Alpine:v3.24
before 2024.07.01-r0
2024.07.01-r0
youtube-dl
Debian:12
All versions, plus listed versions
2021.12.17-2
None known
yt-dlp
Debian:12
All versions, plus listed versions
2023.03.04-12023.06.21-12023.06.22-12023.06.22-1~bpo12+12023.07.06-1
Show 45 moreShow less
2023.07.06-1~bpo12+12023.09.24-12023.09.24-22023.09.24-2~bpo12+12023.10.07-12023.10.07-1~bpo12+12023.10.13-12023.10.13-1~bpo11+12023.10.13-1~bpo12+12023.11.16-12023.11.16-1~bpo11+12023.11.16-1~bpo12+12023.12.30-12024.03.10-12024.03.10-1~bpo12+12024.04.09-12024.04.09-1~bpo12+12024.05.26-12024.05.26-1~bpo12+12024.05.27-12024.05.27-1~bpo12+12024.07.01-12024.07.02-12024.07.02-1~bpo12+12024.07.07-12024.07.09-12024.07.09-1~bpo12+12024.07.16-12024.07.16-1~bpo12+12024.07.25-12024.07.25-1~bpo12+12024.08.01-12024.08.01-1~bpo12+12024.08.06-12024.08.06-1~bpo12+12024.09.27-12024.09.27-1~bpo12+12024.10.07-12024.10.07-1~bpo12+12024.10.22-12024.10.22-1~bpo12+12024.11.04-12024.11.18-12024.11.18-1~bpo12+12024.12.03-1
None known
yt-dlp
Debian:13
before 2024.07.01-1
2024.07.01-1
yt-dlp
Debian:14
before 2024.07.01-1
2024.07.01-1
yt-dlp
PyPI
before 2024.07.01, plus listed versions
2021.1.152021.1.15.post12021.1.162021.1.202021.1.24
Show 45 moreShow less
2021.1.24.post12021.1.292021.10.102021.10.222021.10.92021.11.102021.11.10.12021.12.12021.12.252021.12.272021.2.152021.2.192021.2.242021.2.42021.2.92021.3.12021.3.152021.3.212021.3.242021.3.24.12021.3.32021.3.3.12021.3.3.22021.3.72021.4.112021.4.222021.4.32021.5.112021.5.202021.6.12021.6.232021.6.82021.6.92021.7.212021.7.242021.7.72021.8.102021.8.22021.9.12021.9.22021.9.252022.1.212022.10.42022.11.112022.2.3
2024.07.01
Show 6 moreShow less
Affected packages
PackageAffectedFixed
yt-dlp
Ubuntu:22.04:LTS
All versions, plus listed versions
2021.12.01-12021.12.27-12022.01.21-12022.02.04-12022.03.08.1-12022.04.08-1
None known
yt-dlp
Ubuntu:24.04:LTS
All versions, plus listed versions
2023.07.06-12023.10.13-1ubuntu12023.11.16-12023.12.30-1ubuntu12024.03.10-12024.04.09-1
None known
yt-dlp
Ubuntu:25.10
All versions, plus listed versions
2025.03.27-12025.04.30-12025.05.22-12025.06.09-12025.06.25-1
Show 8 moreShow less
2025.06.30-12025.07.21-12025.08.11-12025.08.20-12025.08.22-12025.08.27-12025.09.05-12025.09.23-1
None known
yt-dlp
Ubuntu:26.10
All versions, plus listed versions
2026.03.17-12026.06.09-12026.07.04-12026.08.19-1
None known
yt-dlp
Ubuntu:26.04:LTS
All versions, plus listed versions
2025.09.23-12025.10.22-12025.11.12-12025.12.08-12026.01.31-12026.03.17-1
None known
yt-dlp
openSUSE:Tumbleweed
before 2024.07.01-1.1
2024.07.01-1.1

History

History
RecordedChangedSources
affected, aliases, referencesOSV
aliases, publishedEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2024-38519 is a high vulnerability (CVSS 7.8) in Yt-dlp, published July 2, 2024. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.33%, the 25th percentile. Fixed in yt-dlp 2024.07.01.

References

Show 13 moreShow less
This page doesn't list everything

Left out here: 220 versions. The JSON record has them.

MoveEnter Open