🇰🇷 한글 설명
NLTK 3.9.3 미만 버전의 nltk.collocations 모듈에서 eval 주입 취약점이 발견되었습니다. 공격자가 명령줄 인자를 제어할 수 있는 경우, 검증되지 않은 인자가 eval() 함수로 전달되어 임의의 파이썬 코드를 실행할 수 있습니다.
💡 쉬운 설명
프로그램이 사용자가 입력한 명령어를 검사 없이 그대로 실행하여 발생하는 보안 문제입니다. 해커가 악성 코드를 입력하면 컴퓨터의 제어권을 탈취하거나 명령을 내릴 수 있습니다.
🇺🇸 원문 (English)
NLTK (Natural Language Toolkit) before version 3.9.3 contains an eval injection vulnerability in the nltk.collocations module that allows an attacker who controls command-line arguments to execute arbitrary Python code. When collocations.py is invoked directly, the __main__ block passes command-line arguments directly to eval() as suffixes of BigramAssocMeasures without allowlist validation or sanitization, enabling an attacker to supply a Python expression that escapes the intended attribute lookup and executes arbitrary code including OS commands via the os module.
📍 영향받는 시스템
NLTK (Natural Language Toolkit) version 3.9.3 미만
⚔️ 공격 벡터
collocations.py를 직접 호출할 때 조작된 명령줄 인자를 전달하여 eval() 함수를 통한 코드 실행
🛡️ 대응 방법
NLTK 라이브러리를 최신 버전인 3.9.3 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 버전 번호가 3.9.3보다 낮으면 취약한 상태입니다.
python3 -c "import nltk; print(nltk.__version__)"