youtube-dl
Affected
- introduced
2015.01.25, last affected2021.12.17(ecosystem)
Fixed versions
None listed
Fix
No fixed version is listed.
Advisory
Also known as: None
youtube-dl vulnerable to file system modification and RCE through improper file-extension sanitization
Description
This advisory follows the security advisory GHSA-79w7-vh3h-8g4j published by the _yt-dlp/yt-dlp_ project to aid remediation of the issue in the _ytdl-org/youtube-dl_ project.
Vulnerability
_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).
Impact
Since _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.
Patches
The 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.
Master code d42a222 or later and nightly builds tagged 2024-07-03 or later contain the remediation.
Workarounds
Any/all of the below considerations may limit exposure in case it is necessary to use a vulnerable version
.%(ext)s at the end of the output templatePATH or other sensitive locations, such as your user directory or system directoriesPATHnon_existent_dir\..\..\target does not exist in Linux or macOS--get-filename)--write-subs/ --write-srt, --write-auto-subs/--write-automatic-subs, --all-subs).References
High Basis: The source's own band: HIGH
2015.01.25, last affected 2021.12.17 (ecosystem)None listed
No fixed version is listed.
Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0