🇰🇷 한글 설명
Python 2.7.14 버전에서 다중 스레드가 대량의 데이터를 처리할 때 힙 버퍼 오버플로우 및 Use-After-Free 취약점이 발생할 수 있습니다. 이는 스레드 간의 레이스 컨디션으로 인해 메모리 오염이 발생하며, FaaS와 같은 환경에서 신뢰 경계를 침해할 위험이 있습니다.
💡 쉬운 설명
여러 작업이 동시에 실행될 때 메모리를 관리하는 순서가 꼬여서 발생하는 문제입니다. 이로 인해 프로그램이 예상치 못한 동작을 하거나 메모리 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
Python 2.7.14 is vulnerable to a Heap-Buffer-Overflow as well as a Heap-Use-After-Free. Python versions prior to 2.7.14 may also be vulnerable and it appears that Python 2.7.17 and prior may also be vulnerable however this has not been confirmed. The vulnerability lies when multiply threads are handling large amounts of data. In both cases there is essentially a race condition that occurs. For the Heap-Buffer-Overflow, Thread 2 is creating the size for a buffer, but Thread1 is already writing to the buffer without knowing how much to write. So when a large amount of data is being processed, it is very easy to cause memory corruption using a Heap-Buffer-Overflow. As for the Use-After-Free, Thread3->Malloc->Thread1->Free's->Thread2-Re-uses-Free'd Memory. The PSRT has stated that this is not a security vulnerability due to the fact that the attacker must be able to run code, however in some situations, such as function as a service, this vulnerability can potentially be used by an attacker to violate a trust boundary, as such the DWF feels this issue deserves a CVE.
📍 영향받는 시스템
Python 2.7.14 및 그 이전 버전 (2.7.17 이하 버전도 잠재적 영향 가능성 있음)
⚔️ 공격 벡터
다중 스레드 환경에서 대량의 데이터를 처리하여 레이스 컨디션을 유도함으로써 메모리 오염 발생
🛡️ 대응 방법
Python 버전을 2.7.14 이상(가급적 최신 보안 패치가 적용된 버전)으로 업데이트
🔧 검증 코드
출력된 버전이 2.7.14 이하인 경우 해당 취약점에 노출되었을 가능성이 높습니다.
python --version 2>/dev/null | grep -E 'Python 2\.7\.[0-9]{1,2}'