🇰🇷 한글 설명
Python의 urllib.parse.urlsplit 및 urlparse 함수가 RFC 3986 표준에 위배되는 대괄호가 포함된 도메인 이름을 잘못 허용합니다. 이는 Python 파서와 RFC 준수 파서 간의 불일치를 야기하며, 이 차이를 악용한 URL 파싱 우회 공격으로 악용될 수 있습니다.
💡 쉬운 설명
Python에서 URL을 분석할 때 잘못된 형식(틀린 위치의 대괄호)을 정상으로 처리하는 문제입니다. 다른 프로그램들은 이를 거부하므로, 보안 검사를 우회하고 혼동을 초래할 수 있습니다.
🇺🇸 원문 (English)
The Python standard library functions `urllib.parse.urlsplit` and `urlparse` accepted domain names that included square brackets which isn't valid according to RFC 3986. Square brackets are only meant to be used as delimiters for specifying IPv6 and IPvFuture hosts in URLs. This could result in differential parsing across the Python URL parser and other specification-compliant URL parsers.
📍 영향받는 시스템
Python 표준 라이브러리 urllib.parse 모듈 (모든 Python 버전, 패치 전)
⚔️ 공격 벡터
차등 파싱 공격(Differential Parsing)으로 Python 기반 웹 애플리케이션의 URL 검증 필터를 우회하여 악의적 요청 전달
🛡️ 대응 방법
Python을 최신 보안 패치가 적용된 버전으로 업그레이드
🔧 검증 코드
Python 버전 확인 후 urlsplit이 [test]example.com을 올바르게 거부하면(ValueError 또는 RFC 준수 동작) 패치됨
python3 --version && python3 -c "from urllib.parse import urlsplit; result = urlsplit('http://[test]example.com/'); print(f'netloc={result.netloc}')"