[ie] Limit netrc_machine parameter to shell-safe characters
Also adapts some extractor regexes to adhere to this limitation See: https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-g3gw-q23r-pgqm Authored by: Grub4K
This commit is contained in:
parent
c105461647
commit
1fbbe29b99
5 changed files with 17 additions and 8 deletions
|
|
@ -76,6 +76,8 @@ class TestInfoExtractor(unittest.TestCase):
|
|||
self.assertEqual(ie._get_netrc_login_info(netrc_machine='empty_pass'), ('user', ''))
|
||||
self.assertEqual(ie._get_netrc_login_info(netrc_machine='both_empty'), ('', ''))
|
||||
self.assertEqual(ie._get_netrc_login_info(netrc_machine='nonexistent'), (None, None))
|
||||
with self.assertRaises(ExtractorError):
|
||||
ie._get_netrc_login_info(netrc_machine=';echo rce')
|
||||
|
||||
def test_html_search_regex(self):
|
||||
html = '<p id="foo">Watch this <a href="http://www.youtube.com/watch?v=BaW_jenozKc">video</a></p>'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue