CVE-2024-22423 json
yt-dlp `--exec` command injection when using `%q` in yt-dlp on Windows
published 2024-04-09 2 y ago modified 2026-07-07 4 mo ago also EUVD-2024-1216 , GHSA-hjq6-52gw-2g7p , PYSEC-2026-2066
- cvss
- 8.4
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 1.4%
- EPSS 1.4% chance of exploitation in 30 days, percentile 73%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- pypi yt-dlp 2024.04.09
- yt-dlp_project yt-dlp 2024.04.09
- yt-dlp openSUSE Tumbleweed 2024.04.09-1.1
opensuse advisories openSUSE-SU-2024:13854-1
- yt-dlp Alpine 3.24, Alpine 3.23, Alpine 3.22 +2 more 0-r0
alpine advisories ALPINE-CVE-2024-22423
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2024-22423 updated
yt-dlp: Fail to Escape Arguments Properly in Microsoft Windows
-
Red Hat All currently supported Red Hat productsnot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
- Assessed
- 2 y ago
Exploit prediction
1.43% chance of exploitation in the next 30 days, higher than 73% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- github.com https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-hjq6-52gw-2g7p referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 8.4 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H |
| GitHub | 3.1 | 8.3 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H |
| NVD | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| OSV | 3.1 | 8.3 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | yt-dlp | >=2021.04.11, <2024.04.09 |
2024.04.09 |
Affected products
- yt-dlp yt-dlp
Classification
- Weakness
-
- CWE-78 Improper Neutralization of Special Elements used in an OS Command
References
-
github.com
/yt-dlp/yt-dlp/commit/de015e930747165dbb8fcd360f8775fd973b7d6e
web, patch
-
github.com
/yt-dlp/yt-dlp/commit/ff07792676f404ffff6ee61b5638c9dc1a33a37a
web, patch
-
github.com
/yt-dlp/yt-dlp/security/advisories/GHSA-hjq6-52gw-2g7p
web, exploit, vendor-advisory
-
github.com
/yt-dlp/yt-dlp/security/advisories/GHSA-42h4-v29r-42qg
web, not-applicable
-
github.com
/yt-dlp/yt-dlp/releases/tag/2021.04.11
web, product, release-notes
-
github.com
/yt-dlp/yt-dlp/releases/tag/2024.04.09
web, product, release-notes
-
kb.cert.org
/vuls/id/123335
web, third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2024-22423
advisory
-
github.com
/yt-dlp/yt-dlp
package
-
pypi.org
/project/yt-dlp
package
-
github.com
/advisories/GHSA-hjq6-52gw-2g7p
advisory
Sources
- CVE List CVE-2024-22423
- GitHub Advisory GHSA-hjq6-52gw-2g7p
- NVD CVE-2024-22423
- OSV PYSEC-2026-2066
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.
CPEs and fixed versions use Anchore's correction of NVD's data: Added CPE configurations because not yet analyzed by NVD.