🇰🇷 한글 설명
NLTK(Natural Language Toolkit) 3.6.5 미만 버전에서 정규 표현식 서비스 거부(ReDoS) 취약점이 발견되었습니다. PunktSentenceTokenizer, sent_tokenize, word_tokenize 함수에 특수하게 제작된 긴 입력값을 전달하면 실행 시간이 급격히 증가하여 시스템이 마비될 수 있습니다.
💡 쉬운 설명
특정한 패턴을 가진 아주 긴 문장을 입력하면 프로그램이 이를 처리하느라 과도하게 계산을 반복하게 됩니다. 이로 인해 서비스가 멈추거나 컴퓨터가 느려지는 현상이 발생할 수 있습니다.
🇺🇸 원문 (English)
NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research and development in Natural Language Processing. Versions prior to 3.6.5 are vulnerable to regular expression denial of service (ReDoS) attacks. The vulnerability is present in PunktSentenceTokenizer, sent_tokenize and word_tokenize. Any users of this class, or these two functions, are vulnerable to the ReDoS attack. In short, a specifically crafted long input to any of these vulnerable functions will cause them to take a significant amount of execution time. If your program relies on any of the vulnerable functions for tokenizing unpredictable user input, then we would strongly recommend upgrading to a version of NLTK without the vulnerability. For users unable to upgrade the execution time can be bounded by limiting the maximum length of an input to any of the vulnerable functions. Our recommendation is to implement such a limit.
📍 영향받는 시스템
NLTK versions prior to 3.6.5
⚔️ 공격 벡터
취약한 토큰화 함수에 정규식 엔진을 과부하시키는 특수하게 조작된 긴 문자열 입력
🛡️ 대응 방법
NLTK를 3.6.5 이상의 버전으로 업그레이드하거나, 입력값의 최대 길이를 제한하는 로직을 구현하십시오.
🔧 검증 코드
출력된 버전 번호가 3.6.5보다 낮으면 취약한 상태입니다.
pip show nltk | grep Version