🇰🇷 한글 설명
sh 라이브러리 2.2.4 미만 버전에서 Linux 및 Unix 계열 시스템의 _uid 옵션이 권한을 불완전하게 낮추는 취약점이 발견되었습니다. 권한이 상승된 프로세스에서 실행된 자식 프로세스가 UID는 변경되더라도 부모 프로세스의 보조 그룹 권한을 그대로 유지할 수 있어 보안 경계를 위반할 수 있습니다.
💡 쉬운 설명
프로그램이 권한을 낮추어 실행될 때, 사용자 아이디는 바뀌지만 관리자 권한을 가진 그룹 정보는 그대로 남는 문제입니다. 이로 인해 일반 사용자로 실행된 프로그램이 원래는 접근할 수 없는 중요한 파일이나 시스템 자원에 접근할 수 있게 됩니다.
🇺🇸 원문 (English)
sh provides Python process launching. Prior to 2.2.4, the _uid option in sh.py performs an incomplete privilege drop on Linux and Unix-like systems. When sh runs from an elevated process and launches a command with _uid set to an unprivileged user, the child changes its UID but can retain the parent process's supplementary groups because the privilege-drop sequence does not fully establish the target user's UID, primary GID, and supplementary groups. The child can therefore retain access to files or resources granted to privileged groups such as root, docker, disk, shadow, or sudo, violating the expected _uid privilege boundary. This issue is fixed in version 2.2.4.
📍 영향받는 시스템
sh library versions prior to 2.2.4
⚔️ 공격 벡터
권한이 높은 프로세스에서 _uid 옵션을 사용하여 낮은 권한의 명령을 실행할 때 발생하는 권한 상승 취약점
🛡️ 대응 방법
sh 라이브러리를 2.2.4 버전 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 버전 번호가 2.2.4 미만이면 취약한 상태이며, 2.2.4 이상이면 안전합니다.
python3 -c 'import sh; print(sh.__version__)' 2>/dev/null || echo 'sh not installed'