Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐍 PyPI

GHSA-3v33-3wmw-3785

yt-dlp has dependency on potentially malicious third-party code in Douyu extractors

Published
Jul 8, 2024
Updated
Dec 6, 2024
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed

Blast Radius

1 pkg affected
🐍yt-dlp

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.

Description

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. bootcdn.net is owned by the bad actor responsible for the Polyfill JS 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 promptly after bootcdn.net was discovered to be under control of the same bad actor behind the polyfill.io supply chain attack.

References

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐍PyPIyt-dlp2023.09.24&&< 2024.07.072024.07.07

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for yt-dlp. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Fix

    Update yt-dlp to 2024.07.07 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-3v33-3wmw-3785 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether GHSA-3v33-3wmw-3785 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to GHSA-3v33-3wmw-3785. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

### 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
O3 Security · Impact-Aware SCA

Is GHSA-3v33-3wmw-3785 in your dependencies?

O3 detects GHSA-3v33-3wmw-3785 across PyPI dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.