{"schemaVersion":3,"id":"GHSA-22FP-MF44-F2MQ","aliases":[],"status":"published","duplicateOf":null,"title":null,"description":"youtube-dl vulnerable to file system modification and RCE through improper file-extension sanitization\n\n#### Description\nThis advisory follows the security advisory [GHSA-79w7-vh3h-8g4j published by the _yt-dlp/yt-dlp_ project](https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-79w7-vh3h-8g4j) to aid remediation of the issue in the _ytdl-org/youtube-dl_ project.\n\n### Vulnerability\n_youtube-dl_ 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).\n\n### Impact\nSince _youtube-dl_ also reads config from the working directory (and, on Windows, executables will be executed from the _youtube-dl_ directory by default) the vulnerability could allow the unwanted execution of local code, including downloads masquerading as, eg, subtitles.\n\n### Patches\nThe versions of _youtube-dl_ listed as _Patched_ remediate this vulnerability by disallowing path separators and whitelisting allowed extensions. As a result, some very uncommon extensions might not get downloaded.\n\n**Master code d42a222 or later and nightly builds tagged 2024-07-03 or later** contain the remediation.\n\n### Workarounds\nAny/all of the below considerations may limit exposure in case it is necessary to use a vulnerable version\n* have `.%(ext)s` at the end of the output template\n* download from websites that you trust\n* do not download to a directory within the executable search `PATH` or other sensitive locations, such as your user directory or system directories\n* in Windows versions that support it, set [`NoDefaultCurrentDirectoryInExePath`](https://stackoverflow.com/a/50118548) to prevent the _cmd_ shell's executable search adding the default directory before `PATH`\n* consider that the path traversal vulnerability as a result of resolving `non_existent_dir\\..\\..\\target` does not exist in Linux or macOS\n* ensure the extension of the media to download is a common video/audio/... one (use `--get-filename`)\n* omit any of the subtitle options (`--write-subs`/` --write-srt`, `--write-auto-subs`/`--write-automatic-subs`, `--all-subs`).\n\n### References\n* [GHSA-79w7-vh3h-8g4j](https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-79w7-vh3h-8g4j)\n* https://github.com/ytdl-org/youtube-dl/pull/32830","dates":{"published":"2025-04-18T20:24:07.000Z","modified":"2026-02-04T02:44:06.010Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":7.8,"severity":"high","version":"3.1","versionLabel":"v3.1","source":"OSV · Pypi","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","computed":true,"selection":"version-preference"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"OSV · Pypi","score":7.8,"severity":"high","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","exploitability":4.6,"impact":9.8,"computed":true}]},"epss":{"probability":null,"percentile":null,"severity":"unknown","asOf":null,"change":{"pp":null,"baselineDate":null,"baselineScore":null},"history":[],"last30":[]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[],"exploitCount":0,"weaknesses":[],"affected":[{"vendor":"PyPI","product":"youtube-dl","name":"youtube-dl","label":"youtube-dl","ecosystem":"PyPI","cpePart":null,"purl":"pkg:pypi/youtube-dl","purlType":"pypi","versions":[{"text":"≥ 2015.01.25, ≤ 2021.12.17","noFixRecorded":false,"fixedIn":null}],"versionsText":"≥ 2015.01.25, ≤ 2021.12.17","eol":null,"hubHref":null}],"affectedCount":1,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://github.com/dirkf/youtube-dl/security/advisories/GHSA-22fp-mf44-f2mq","label":"github.com/dirkf/youtube-dl/security/advisories/GHSA-22fp-mf44-f2mq","hostname":"github.com","tags":["WEB"]},{"url":"https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-79w7-vh3h-8g4j","label":"github.com/yt-dlp/yt-dlp/security/advisories/GHSA-79w7-vh3h-8g4j","hostname":"github.com","tags":["WEB"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-38519","label":"nvd.nist.gov/vuln/detail/CVE-2024-38519","hostname":"nvd.nist.gov","tags":["Advisory"]},{"url":"https://github.com/ytdl-org/youtube-dl/pull/32830","label":"github.com/ytdl-org/youtube-dl/pull/32830","hostname":"github.com","tags":["WEB"]},{"url":"https://github.com/ytdl-org/youtube-dl/commit/d42a222ed541b96649396ef00e19552aef0f09ec","label":"github.com/ytdl-org/youtube-dl/commit/d42a222ed541b96649396ef00e19552aef0f09ec","hostname":"github.com","tags":["WEB"]},{"url":"https://github.com/dirkf/youtube-dl","label":"github.com/dirkf/youtube-dl","hostname":"github.com","tags":["PACKAGE"]},{"url":"https://securitylab.github.com/advisories/GHSL-2024-089_youtube-dl","label":"securitylab.github.com/advisories/GHSL-2024-089_youtube-dl","hostname":"securitylab.github.com","tags":["Advisory"]}],"lineage":{"upstream":[],"downstream":[],"duplicates":[],"related":["CVE-2024-38519"]},"timeline":[{"kind":"published","date":"2025-04-18T20:24:07.000Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2026-02-04T02:44:06.010Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":31,"level":"medium","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-22T07:38:35.376Z","stale":false,"partial":false}}