Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS0zdjMzLTN3bXctMzc4Nc4AA9n3

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

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:

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

Permalink: https://github.com/advisories/GHSA-3v33-3wmw-3785
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS0zdjMzLTN3bXctMzc4Nc4AA9n3
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Low
Classification: General
Published: 5 months ago
Updated: 5 months ago


Identifiers: GHSA-3v33-3wmw-3785
References: Repository: https://github.com/yt-dlp/yt-dlp
Blast Radius: 0.0

Affected Packages

pypi:yt-dlp
Dependent packages: 251
Dependent repositories: 3,540
Downloads: 2,322,274 last month
Affected Version Ranges: >= 2023.09.24, < 2024.07.07
Fixed in: 2024.07.07
All affected versions: 2023.9.24, 2023.10.7, 2023.10.13, 2023.11.14, 2023.11.16, 2023.12.30, 2024.3.10, 2024.4.9, 2024.5.26, 2024.5.27, 2024.7.1, 2024.7.2
All unaffected versions: 2021.1.15, 2021.1.16, 2021.1.20, 2021.1.24, 2021.1.29, 2021.2.4, 2021.2.9, 2021.2.15, 2021.2.19, 2021.2.24, 2021.3.1, 2021.3.3, 2021.3.7, 2021.3.15, 2021.3.21, 2021.3.24, 2021.4.3, 2021.4.11, 2021.4.22, 2021.5.11, 2021.5.20, 2021.6.1, 2021.6.8, 2021.6.9, 2021.6.23, 2021.7.7, 2021.7.21, 2021.7.24, 2021.8.2, 2021.8.10, 2021.9.1, 2021.9.2, 2021.9.25, 2021.10.9, 2021.10.10, 2021.10.22, 2021.11.10, 2021.12.1, 2021.12.25, 2021.12.27, 2022.1.21, 2022.2.3, 2022.2.4, 2022.3.8, 2022.4.8, 2022.5.18, 2022.6.22, 2022.6.29, 2022.7.17, 2022.7.18, 2022.8.8, 2022.8.14, 2022.8.19, 2022.9.1, 2022.10.4, 2022.11.11, 2023.1.2, 2023.1.6, 2023.2.17, 2023.3.3, 2023.3.4, 2023.6.21, 2023.6.22, 2023.7.6, 2024.7.7, 2024.7.8, 2024.7.9, 2024.7.16, 2024.7.25, 2024.8.1, 2024.8.6, 2024.9.27, 2024.10.7, 2024.10.22, 2024.11.4, 2024.11.18