🇰🇷 한글 설명
PyPDF2 라이브러리의 ContentStream._readInlineImage 함수에서 EI 토큰을 찾을 때까지 루프가 종료되지 않는 취약점이 발견되었습니다. 공격자가 조작된 PDF 파일을 제공할 경우, 라이브러리가 콘텐츠 스트림을 읽는 과정에서 무한 루프에 빠질 수 있습니다.
💡 쉬운 설명
특수하게 만들어진 PDF 파일을 열려고 하면 프로그램이 끝없이 계산을 반복하며 멈춰버리는 문제입니다. 이로 인해 서비스가 중단되거나 컴퓨터 자원이 과도하게 사용될 수 있습니다.
🇺🇸 원문 (English)
PyPDF2 is an open source python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files. In versions prior to 1.27.5 an attacker who uses this vulnerability can craft a PDF which leads to an infinite loop if the PyPDF2 if the code attempts to get the content stream. The reason is that the last while-loop in `ContentStream._readInlineImage` only terminates when it finds the `EI` token, but never actually checks if the stream has already ended. This issue has been resolved in version `1.27.5`. Users unable to upgrade should validate and PDFs prior to iterating over their content stream.
📍 영향받는 시스템
PyPDF2 1.27.5 미만 버전
⚔️ 공격 벡터
조작된 PDF 파일을 시스템에 업로드하거나 처리하도록 유도하여 무한 루프 발생
🛡️ 대응 방법
PyPDF2를 1.27.5 이상 버전으로 업데이트하거나, 처리 전 PDF 파일의 유효성을 검증함
🔧 검증 코드
출력된 버전 번호가 1.27.5보다 낮으면 취약한 상태입니다.
pip show PyPDF2 | grep Version