🇰🇷 한글 설명
lxml은 Python에서 XML과 HTML을 처리하는 라이브러리입니다. 6.1.0 버전 이전에서는 기본 설정(resolve_entities=True)으로 실행할 때 신뢰할 수 없는 XML 입력을 통해 로컬 파일을 읽을 수 있는 XXE(XML External Entity) 취약점이 존재합니다. resolve_entities를 명시적으로 False로 설정하면 로컬 파일 접근을 차단할 수 있으며, 버전 6.1.0에서 수정되었습니다.
💡 쉬운 설명
lxml 라이브러리가 악의적인 XML을 받으면 컴퓨터의 민감한 파일(비밀번호, 설정 파일 등)을 읽을 수 있습니다. 버전을 6.1.0 이상으로 업그레이드하면 이 문제가 해결됩니다.
🇺🇸 원문 (English)
lxml is a library for processing XML and HTML in the Python language. Prior to 6.1.0, using either of the two parsers in the default configuration (with resolve_entities=True) allows untrusted XML input to read local files. Setting the resolve_entities option explicitly to resolve_entities='internal' or resolve_entities=False disables the local file access. This vulnerability is fixed in 6.1.0.
📍 영향받는 시스템
lxml < 6.1.0 (모든 Python 버전)
⚔️ 공격 벡터
특수하게 조작된 XML 파일을 lxml의 기본 설정으로 파싱할 때 로컬 파일 접근 가능
🛡️ 대응 방법
lxml을 6.1.0 이상으로 업그레이드 또는 resolve_entities=False로 명시적 설정
🔧 검증 코드
6.1.0 이상이면 안전, 그 이하이면 XXE 취약점 노출
python3 -c "import lxml; print(lxml.__version__)" 2>/dev/null