🇰🇷 한글 설명
Python 2.5.2 이전 버전에서 PyString_FromStringAndSize 함수에 음수 크기 값이 전달될 때 발생하는 버퍼 오버플로우 취약점입니다. assert() 함수가 비활성화된 환경에서 예상보다 적은 메모리가 할당되어 메모리 경계를 넘어 데이터를 쓸 수 있고, 이를 통해 임의의 코드 실행이 가능합니다.
💡 쉬운 설명
Python에서 문자열 처리 시 음수값 입력으로 메모리 할당이 실패하고 보안 검사가 우회됩니다. 공격자가 이를 악용하면 컴퓨터에서 원하는 명령을 실행할 수 있습니다.
🇺🇸 원문 (English)
Python 2.5.2 and earlier allows context-dependent attackers to execute arbitrary code via multiple vectors that cause a negative size value to be provided to the PyString_FromStringAndSize function, which allocates less memory than expected when assert() is disabled and triggers a buffer overflow.
📍 영향받는 시스템
Python 2.5.2 이전 모든 버전 (2.5.2, 2.5.1, 2.5.0, 2.4.x, 2.3.x 등)
⚔️ 공격 벡터
여러 가지 방법으로 PyString_FromStringAndSize 함수에 음수 크기값을 전달하여 버퍼 오버플로우 발생
🛡️ 대응 방법
Python을 2.5.3 이상으로 업그레이드하거나 공식 보안 패치 적용
🔧 검증 코드
vulnerable이면 패치 필요, patched이면 현재 버전은 안전합니다.
python -c "import sys; v=sys.version_info; print('vulnerable' if v[0]==2 and v[1]==5 and v[2]<=2 else 'patched')"