🇰🇷 한글 설명
오픈소스 OCR 엔진인 Tesseract 5.5.3 및 이전 버전에서 .traineddata 파일의 NORMPROTO 구성 요소를 처리할 때 스택 버퍼 오버플로우 취약점이 발생합니다. 공격자가 조작된 파일을 사용하면 스택 손상, 서비스 거부(DoS) 또는 제어 흐름 탈취가 가능할 수 있습니다.
💡 쉬운 설명
Tesseract라는 글자 인식 프로그램이 특수하게 만들어진 파일을 읽을 때, 준비된 메모리 공간보다 더 많은 데이터를 입력받아 프로그램이 고장 나거나 해킹될 수 있는 문제입니다. 공격자가 만든 파일을 읽게 만드는 것만으로도 컴퓨터를 멈추게 하거나 권한을 뺏을 수 있습니다.
🇺🇸 원문 (English)
Tesseract is an open source OCR engine. In version 5.5.3 and earlier, Classify::ReadNormProtos in src/classify/normmatch.cpp parses the NORMPROTO component of a .traineddata file and uses std::istream::operator>>(char*) to extract a whitespace-delimited token into a fixed 61-byte stack buffer without setting a stream width. The 100-byte line buffer can carry a token of up to 99 characters, so a token longer than 60 characters writes up to 39 attacker-controlled bytes past the buffer during TessBaseAPI::Init of the legacy engine, causing stack corruption, denial of service, and potentially control-flow hijacking on affected standard-library implementations. Builds using Apple's libc++ C++20 bounded array overload are incidentally protected, while typical libstdc++ builds remain affected. No fixed release is available as of this review.
📍 영향받는 시스템
Tesseract OCR version 5.5.3 and earlier (libstdc++ 사용 환경)
⚔️ 공격 벡터
조작된 .traineddata 파일을 Tesseract 엔진에 입력하여 TessBaseAPI::Init 호출 시 발생
🛡️ 대응 방법
공식 패치가 출시될 때까지 신뢰할 수 없는 출처의 .traineddata 파일 사용을 금지하고, 가능한 경우 Apple libc++ 환경을 사용하십시오.
🔧 검증 코드
출력 결과에 5.5.3 이하의 버전 번호가 나타나면 해당 취약점에 노출된 상태입니다.
tesseract --version 2>/dev/null | grep -E '5\[.0-5\.3\]'