GHSA-3v33-3wmw-3785: Yt dlp Yt-dlp Has Dependency On Potentially Vulnerability

LOW
Published
Advisory Summary

GHSA-3v33-3wmw-3785 is a LOW yt-dlp has dependency on potentially vulnerability (General Security Weakness) affecting Yt dlp libraries in the PyPI ecosystem. The issue involves yt-dlp has dependency on potentially malicious third-party code in douyu extractors. Remediation is available by upgrading affected packages to version 2024.07.07.

GHSA-3v33-3wmw-3785 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-3v33-3wmw-3785
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Yt dlp
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix GHSA-3v33-3wmw-3785

To remediate this vulnerability, upgrade all affected Yt dlp dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

yt-dlp fixed: 2024.07.07
pip install yt-dlp>=2024.07.07
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show yt-dlp

How to Check if You Are Affected

To determine whether your Python environment is affected by GHSA-3v33-3wmw-3785, inspect your installed packages using pip:

pip show yt-dlp

Analyze the terminal output to locate any version of Yt dlp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2024.07.07), your application is affected.

Note: The pip show yt-dlp command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Yt dlp, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact yt-dlp's DouyuTV and DouyuShow extractors used a `cdn.bootcdn.net` URL as a fallback for fetching a component of the crypto-js JavaScript library. When the Douyu extractor is used, yt-dlp extracts this JavaScript code and attempts to execute it externally using [PhantomJS](https://github.com/ariya/phantomjs). `bootcdn.net` is owned by the bad actor responsible for the [Polyfill JS supply chain attack](https://sansec.io/research/polyfill-supply-chain-attack) that has been ongoing since at least June 2023. While there is no evidence that PhantomJS has been targeted by or is vulnerable to any attacks carried out by the Polyfill JS actor, there is the possibility that malicious JavaScript code may have been downloaded/cached by yt-dlp or executed by PhantomJS. In order for this potential vulnerability to be exploited by any hypothetical attack, all 3 of the following conditions must be met: 1. The user has PhantomJS installed on their system. 2. The user passes a `douyu.com` or `douyutv.com` URL to yt-dlp as input, or passes a URL that redirects to one of these domains. 3. `cdnjs.cloudflare.com` is unavailable or blocked at the time of extraction, necessitating the usage of the `cdn.bootcdn.net` fallback; or it had been unavailable during a previous run of the Douyu extractor and JavaScript code from `cdn.bootcdn.net` had been cached to disk. ### Patches yt-dlp version 2024.07.07 fixes this issue by removing the URL pointing to the malicious CDN and by invalidating any Douyu extractor cache data created by unpatched versions of yt-dlp. ### Workarounds It is recommended to upgrade yt-dlp to version 2024.07.07 as soon as possible. For users not able to upgrade: - Avoid using the Douyu extractors (`--ies default,-douyutv,-douyushow`) - Uninstall (or do not install) PhantomJS ### Acknowledgement Thanks to @LeSuisse for [reporting this](https://github.com/yt-dlp/yt-dlp/pull/10347) promptly after `bootcdn.net` was discovered to be under control of the same bad actor behind the `polyfill.io` supply chain attack. ### References - https://github.com/yt-dlp/yt-dlp/commit/6075a029dba70a89675ae1250e7cdfd91f0eba41 - https://sansec.io/research/polyfill-supply-chain-attack

GHSA-3v33-3wmw-3785 Affected Yt dlp Versions

1 component(s)
Fixed Versions:
2024.07.07
Product / Package Ecosystem Affected Versions Fixed Version
yt-dlp
PyPI
≥ 2023.09.24
< 2024.07.07
2024.07.07

References

Frequently Asked Questions

What is GHSA-3v33-3wmw-3785?
GHSA-3v33-3wmw-3785 is a security vulnerability in Yt dlp involving yt-dlp has dependency on potentially malicious third-party code in Douyu extractors under General Security Weakness.
Which Yt dlp versions are affected?
Affected versions include releases prior to 2024.07.07 across affected packages: yt-dlp.
What version fixes GHSA-3v33-3wmw-3785?
Upgrading to 2024.07.07 (or the latest patched release for your respective branch) resolves the vulnerability.
Is yt-dlp affected?
Yes, yt-dlp is affected in releases prior to 2024.07.07. Upgrade your dependency to 2024.07.07 or later.
What CWE is associated with GHSA-3v33-3wmw-3785?
GHSA-3v33-3wmw-3785 is classified under General Security Weakness.
How can I check PyPI dependencies for GHSA-3v33-3wmw-3785?
Run the dependency tree command: 'pip show yt-dlp'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3v33-3wmw-3785",
  "modified" : "2024-07-08T14:22:00Z",
  "published" : "2024-07-08T14:22:00Z",
  "aliases" : [ ],
  "summary" : "yt-dlp has dependency on potentially malicious third-party code in Douyu extractors",
  "details" : "### Impact\nyt-dlp's DouyuTV and DouyuShow extractors used a `cdn.bootcdn.net` URL as a fallback for fetching a component of the crypto-js JavaScript library. When the Douyu extractor is used, yt-dlp extracts this JavaScript code and attempts to execute it externally using [PhantomJS](https://github.com/ariya/phantomjs). `bootcdn.net` is owned by the bad actor responsible for the [Polyfill JS supply chain attack](https://sansec.io/research/polyfill-supply-chain-attack) that has been ongoing since at least June 2023. While there is no evidence that PhantomJS has been targeted by or is vulnerable to any attacks carried out by the Polyfill JS actor, there is the possibility that malicious JavaScript code may have been downloaded/cached by yt-dlp or executed by PhantomJS.\n\nIn order for this potential vulnerability to be exploited by any hypothetical attack, all 3 of the following conditions must be met:\n1. The user has PhantomJS installed on their system.\n2. The user passes a `douyu.com` or `douyutv.com` URL to yt-dlp as input, or passes a URL that redirects to one of these domains.\n3. `cdnjs.cloudflare.com` is unavailable or blocked at the time of extraction, necessitating the usage of the `cdn.bootcdn.net` fallback; or it had been unavailable during a previous run of the Douyu extractor and JavaScript code from `cdn.bootcdn.net` had been cached to disk.\n\n### Patches\nyt-dlp version 2024.07.07 fixes this issue by removing the URL pointing to the malicious CDN and by invalidating any Douyu extractor cache data created by unpatched versions of yt-dlp.\n\n### Workarounds\nIt is recommended to upgrade yt-dlp to version 2024.07.07 as soon as possible.\n\nFor users not able to upgrade:\n- Avoid using the Douyu extractors (`--ies default,-douyutv,-douyushow`)\n- Uninstall (or do not install) PhantomJS\n\n### Acknowledgement\nThanks to @LeSuisse for [reporting this](https://github.com/yt-dlp/yt-dlp/pull/10347) promptly after `bootcdn.net` was discovered to be under control of the same bad actor behind the `polyfill.io` supply chain attack.\n\n### References\n- https://github.com/yt-dlp/yt-dlp/commit/6075a029dba70a89675ae1250e7cdfd91f0eba41\n- https://sansec.io/research/polyfill-supply-chain-attack\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "yt-dlp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2023.09.24"
      }, {
        "fixed" : "2024.07.07"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-3v33-3wmw-3785"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/yt-dlp/yt-dlp/commit/6075a029dba70a89675ae1250e7cdfd91f0eba41"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/yt-dlp/yt-dlp"
  }, {
    "type" : "WEB",
    "url" : "https://sansec.io/research/polyfill-supply-chain-attack"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-07-08T14:22:00Z",
    "nvd_published_at" : null
  }
}