🇰🇷 한글 설명
zsh 5.0.7 미만 버전에서 환경 변수로 가져온 정수형 변수의 초기값을 리터럴 숫자가 아닌 실행 가능한 코드로 평가하는 취약점이 존재합니다. 이는 sudo 실행 시 환경 변수가 적절히 정제되지 않은 특수한 상황에서 로컬 권한 상승을 허용할 수 있습니다.
💡 쉬운 설명
컴퓨터 설정값에 몰래 명령어를 숨겨두면, 관리자 권한으로 프로그램을 실행할 때 그 명령어가 자동으로 실행될 수 있는 문제입니다. 이를 통해 일반 사용자가 관리자 권한을 탈취할 위험이 있습니다.
🇺🇸 원문 (English)
zsh before 5.0.7 allows evaluation of the initial values of integer variables imported from the environment (instead of treating them as literal numbers). That could allow local privilege escalation, under some specific and atypical conditions where zsh is being invoked in privilege-elevation contexts when the environment has not been properly sanitized, such as when zsh is invoked by sudo on systems where "env_reset" has been disabled.
📍 영향받는 시스템
zsh version 5.0.7 미만
⚔️ 공격 벡터
환경 변수가 정제되지 않은 상태에서 sudo 등을 통해 zsh가 실행될 때 조작된 환경 변수 주입
🛡️ 대응 방법
zsh를 5.0.7 이상 버전으로 업데이트하거나 sudo 설정에서 env_reset을 활성화함
🔧 검증 코드
출력된 버전이 5.0.7 미만(예: 5.0.6 또는 4.x)이면 취약한 버전입니다.
zsh --version 2>/dev/null | grep -E 'zsh (5\.[0-5]\.|[0-4]\.)'