mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 22:55:18 +00:00 
			
		
		
		
	[core] Disallow unsafe extensions (CVE-2024-38519)
Ref: https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-79w7-vh3h-8g4j Authored by: Grub4K
This commit is contained in:
		| @@ -64,6 +64,7 @@ from .utils import ( | ||||
|     write_string, | ||||
| ) | ||||
| from .utils.networking import std_headers | ||||
| from .utils._utils import _UnsafeExtensionError | ||||
| from .YoutubeDL import YoutubeDL | ||||
| 
 | ||||
| _IN_CLI = False | ||||
| @@ -593,6 +594,13 @@ def validate_options(opts): | ||||
|     if opts.ap_username is not None and opts.ap_password is None: | ||||
|         opts.ap_password = getpass.getpass('Type TV provider account password and press [Return]: ') | ||||
| 
 | ||||
|     # compat option changes global state destructively; only allow from cli | ||||
|     if 'allow-unsafe-ext' in opts.compat_opts: | ||||
|         warnings.append( | ||||
|             'Using allow-unsafe-ext opens you up to potential attacks. ' | ||||
|             'Use with great care!') | ||||
|         _UnsafeExtensionError.sanitize_extension = lambda x: x | ||||
| 
 | ||||
|     return warnings, deprecation_warnings | ||||
| 
 | ||||
| 
 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Simon Sawicki
					Simon Sawicki