• jpic's avatar
    bpo-34155: Dont parse domains containing @ (GH-13079) · 8cb65d13
    jpic authored
    
    
    Before:
        
            >>> email.message_from_string('From: a@malicious.org@important.com', policy=email.policy.default)['from'].addresses
            (Address(display_name='', username='a', domain='malicious.org'),)
        
            >>> parseaddr('a@malicious.org@important.com')
            ('', 'a@malicious.org')
        
        After:
        
            >>> email.message_from_string('From: a@malicious.org@important.com', policy=email.policy.default)['from'].addresses
            (Address(display_name='', username='', domain=''),)
        
            >>> parseaddr('a@malicious.org@important.com')
            ('', 'a@')
    
    
    
    
    https://bugs.python.org/issue34155
    8cb65d13
_header_value_parser.py 103 KB