-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remediate File Downloader cookie leak #32445
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* support `method` parameter of `Request.__init__` (Py 2 and old Py 3) * support `getcode` method of compat_http_client.HTTPResponse (Py 2)
* Thx coletdjnz: yt-dlp/yt-dlp#7094 * add test that redirected `POST` loses its `Content-Type`
Adated from yt-dlp/yt-dlp-GHSA-v8mc-9377-rwjj/pull/1/commits/101caac Thx coletdjnz
…s_for_url` methods
Cookie string parsing in Py 2.6.9, probably earlier, requires `=`. Also 3.2, though the CPython code appears to be OK: 3.1 was also wrong.
This was referenced Jul 18, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Boilerplate: mixed code, improvement
## Please follow the guide belowx
into all the boxes [ ] relevant to your pull request (like that [x])Before submitting a pull request make sure you have:
In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:
What is the purpose of your pull request?
Description of your pull request and other information
During file downloads, youtube-dl or the external downloaders that it invokes may leak cookies on HTTP redirects to a different host, or leak them when the host for download fragments differs from their parent manifest's host.
This PR implements various remediations to avoid this behaviour:
--add-header "Cookie:..."
is scoped to input URL domain only)These remediations match similar ones committed to yt-dlp:
yt-dlp/yt-dlp@1ceb657
yt-dlp/yt-dlp@f8b4bcc
yt-dlp/yt-dlp@3121512
yt-dlp/yt-dlp@6c5211c
yt-dlp/yt-dlp@42ded0a
Thanks to yt-dlp devs involved in GHSA-v8mc-9377-rwjj, especially those referenced in commits here.