🇰🇷 한글 설명
Tesseract OCR 엔진의 5.4.0 이상 5.5.4 미만 버전에서 pagerenderer.cpp의 AppendLinePolygon 함수가 호출자 소유의 right-to-left Pta 객체를 값으로 받아 파괴하면서 line_top_rtl_pts와 line_bottom_rtl_pts 포인터가 댕글링 상태가 됩니다. 이로 인해 이중 해제 및 해제 후 사용 취약점이 발생하며, 손상된 좌표가 RecalcPolygonline으로 전달될 수 있습니다. 해당 문제는 5.5.4 버전에서 수정되었습니다.
💡 쉬운 설명
문서 이미지를 텍스트로 변환하는 Tesseract 프로그램의 메모리 관리 오류입니다. 특정 히브리어·아랍어 페이지를 처리할 때 프로그램이 이미 삭제된 메모리에 접근하거나 두 번 삭제하여 충돌이나 비정상 동작이 발생할 수 있습니다.
🇺🇸 원문 (English)
Tesseract is an open source OCR engine. From 5.4.0 until 5.5.4, AppendLinePolygon in src/api/pagerenderer.cpp destroys the caller-owned right-to-left Pta accumulator while receiving it by value, leaving line_top_rtl_pts and line_bottom_rtl_pts dangling. On an upright Hebrew or Arabic page at the default PAGE XML level, POLYGONFLAG with a false skewed_flag enters the vulnerable calls, while LEVELFLAG greater than zero provides an alternative gate. The calls repeatedly read and free the stale object, causing a double free and use after free and allowing corrupted coordinates to reach RecalcPolygonline. This issue is fixed in version 5.5.4.
📍 영향받는 시스템
Tesseract OCR 5.4.0 이상 5.5.4 미만 버전
⚔️ 공격 벡터
악의적으로 조작된 히브리어 또는 아랍어 문서 이미지를 Tesseract로 처리하게 하여 메모리 손상을 유발
🛡️ 대응 방법
Tesseract를 5.5.4 이상 버전으로 업데이트하거나 패키지 관리자를 통해 최신 보안 패치를 적용
🔧 검증 코드
출력된 버전이 5.4.0 이상 5.5.4 미만이면 취약하며, 5.5.4 이상이면 패치된 상태입니다. 명령이 실패하면 Tesseract가 설치되어 있지 않은 것입니다.
tesseract --version 2>/dev/null | head -n 1