CVE-2023-46121 in yt-dlp
Summary
by MITRE • 11/15/2023
yt-dlp is a youtube-dl fork with additional features and fixes. 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. Version 2023.11.14 removed the ability to smuggle `http_headers` to the Generic extractor, as well as other extractors that use the same pattern. Users are advised to upgrade. Users unable to upgrade should disable the Ggneric extractor (or only pass trusted sites with trusted content) and ake caution when using `--no-check-certificate`.
Be aware that VulDB is the high quality source for vulnerability data.
Analysis
by VulDB Data Team • 12/10/2023
CVE-2023-46121 represents a significant security vulnerability within yt-dlp, a popular open-source media downloader that serves as a fork of youtube-dl with enhanced features and bug fixes. This vulnerability specifically affects the Generic Extractor component of yt-dlp, which is designed to handle various media sources across different platforms. The flaw stems from improper handling of proxy configurations within the HTTP session management system, creating a pathway for malicious actors to manipulate network requests made by the application. This issue falls under the category of insecure proxy handling as classified by CWE-922, which deals with the storage of sensitive information in a manner that could be exploited by unauthorized parties. The vulnerability operates at the application layer of the network stack, specifically impacting how yt-dlp manages outbound connections and HTTP headers during content retrieval operations.
The technical implementation of this vulnerability allows an attacker to inject arbitrary proxy settings into the HTTP session configuration of yt-dlp, enabling them to redirect requests to any target URL while maintaining the appearance of legitimate traffic originating from the victim's system. This man-in-the-middle capability arises from the application's failure to properly validate or sanitize proxy parameters passed to its HTTP client, creating an opportunity for attackers to intercept and manipulate data flows. When yt-dlp processes media URLs through the Generic Extractor, it can be tricked into routing its requests through attacker-controlled proxy servers, potentially exposing sensitive information including authentication cookies, session tokens, and other confidential data that might be transmitted during the download process. The vulnerability is particularly concerning because it can be exploited through various attack vectors that align with techniques described in the ATT&CK framework under T1071.004 for application layer protocol manipulation.
The operational impact of this vulnerability extends beyond simple data interception, as it can potentially lead to full account compromise when users authenticate with services that rely on cookie-based authentication. Attackers could leverage this vulnerability to harvest authentication cookies from legitimate sessions, enabling them to impersonate users and access protected content or perform unauthorized actions on behalf of victims. The exploitation requires minimal privileges and can be executed remotely, making it particularly dangerous in environments where users might download content from untrusted sources or where the application is used in automated or unattended scenarios. The vulnerability affects all versions of yt-dlp prior to 2023.11.14, and the fix implemented by the development team involved removing the ability to smuggle http_headers to the Generic extractor and similar components that used the same problematic pattern. This remediation approach addresses the root cause by eliminating the mechanism that allowed arbitrary proxy configuration injection.
Organizations and individual users should prioritize upgrading to version 2023.11.14 or later to mitigate this vulnerability, as it represents a critical security risk that could be exploited in various attack scenarios. For users unable to upgrade immediately, several mitigation strategies should be implemented including disabling the Generic extractor entirely when not required, limiting usage to trusted domains only, and exercising extreme caution when employing the --no-check-certificate flag which can further weaken security posture. The ATT&CK framework's T1566.001 for credential access through credential dumping and T1105 for remote file execution through compromised applications provides additional context for the potential exploitation pathways that this vulnerability enables. Users should also consider implementing network-level monitoring to detect unusual proxy usage patterns or unexpected outbound connections that might indicate exploitation attempts. The vulnerability highlights the importance of proper input validation and secure coding practices in network applications, particularly those that handle user-provided URLs and network configurations, and serves as a reminder of the critical need for regular security updates and vulnerability assessments in open-source software ecosystems.