{"cve":"CVE-2024-22423","nvd":{"published":"2024-04-09T18:15:08.150","modified":"2026-06-17T07:11:23.013","status":"Analyzed","description":"yt-dlp is a youtube-dl fork with additional features and fixes. The patch that addressed CVE-2023-40581 attempted to prevent RCE when using `--exec` with `%q` by replacing double quotes with two double quotes. However, this escaping is not sufficient, and still allows expansion of environment variables. Support for output template expansion in `--exec`, along with this vulnerable behavior, was added to `yt-dlp` in version 2021.04.11. yt-dlp version 2024.04.09 fixes this issue by properly escaping `%`. It replaces them with `%%cd:~,%`, a variable that expands to nothing, leaving only the leading percent. It is recommended to upgrade yt-dlp to version 2024.04.09 as soon as possible. Also, always be careful when using `--exec`, because while this specific vulnerability has been patched, using unvalidated input in shell commands is inherently dangerous. For Windows users who are not able to upgrade, avoid using any output template expansion in `--exec` other than `{}` (filepath); if expansion in `--exec` is needed, verify the fields you are using do not contain `\"`, `|` or `&`; and/or instead of using `--exec`, write the info json and load the fields from it instead.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8},"cwes":["CWE-78"],"references":["https://github.com/yt-dlp/yt-dlp/commit/de015e930747165dbb8fcd360f8775fd973b7d6e","https://github.com/yt-dlp/yt-dlp/commit/ff07792676f404ffff6ee61b5638c9dc1a33a37a","https://github.com/yt-dlp/yt-dlp/releases/tag/2021.04.11","https://github.com/yt-dlp/yt-dlp/releases/tag/2024.04.09","https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-42h4-v29r-42qg"],"products":["yt-dlp_project:yt-dlp"],"source":"nvd","synced_at":"2026-10-19T21:48:32.179249784+00:00"},"epss":{"cve":"CVE-2024-22423","score":0.0143,"percentile":0.73015,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-hjq6-52gw-2g7p","url":"https://osv.dev/vulnerability/GHSA-hjq6-52gw-2g7p","summary":"yt-dlp: `--exec` command injection when using `%q` in yt-dlp on Windows (Bypass of CVE-2023-40581)","modified":"2026-07-07T17:56:52.552705416Z","packages":[{"ecosystem":"PyPI","name":"yt-dlp","purl":"pkg:pypi/yt-dlp","ranges":[">=2021.04.11 <2024.04.09"],"fixed":["2024.04.09"]}]},{"id":"PYSEC-2026-2066","url":"https://osv.dev/vulnerability/PYSEC-2026-2066","summary":"yt-dlp: `--exec` command injection when using `%q` in yt-dlp on Windows (Bypass of CVE-2023-40581)","modified":"2026-07-07T17:47:49.312429950Z","packages":[{"ecosystem":"PyPI","name":"yt-dlp","purl":"pkg:pypi/yt-dlp","ranges":[">=2021.04.11 <2024.04.09"],"fixed":["2024.04.09"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}