🇰🇷 한글 설명
PDM 2.26.9 이하 버전에서 초기화 과정 중 프로젝트 로컬 디렉토리(.pdm-plugins)의 플러그인을 자동으로 로드하는 취약점이 발견되었습니다. 공격자가 조작된 .pth 파일을 포함한 저장소를 체크아웃하게 유도하면, 사용자가 pdm 명령어를 실행하는 즉시 임의의 파이썬 코드가 실행될 수 있습니다.
💡 쉬운 설명
PDM이라는 프로그램을 사용할 때, 나쁜 의도를 가진 파일이 포함된 프로젝트를 열기만 해도 컴퓨터가 자동으로 해킹 코드를 실행할 수 있는 문제입니다. 명령어를 입력하는 순간 바로 공격이 시작될 수 있어 매우 위험합니다.
🇺🇸 원문 (English)
PDM is a Python package and dependency manager. In versions up to and including 2.26.9, PDM automatically loads project-local plugins from a .pdm-plugins directory during initialization, allowing an attacker-controlled file in an untrusted repository checkout to execute arbitrary Python code before any command is parsed. This happens because load_plugins() runs during Core.init() and adds .pdm-plugins via site.addsitedir(), which processes .pth files and immediately executes any line beginning with import, so the code runs with the privileges of the user invoking pdm and even a benign command such as pdm --version triggers it (making the impact strongest in CI, automation, and privileged contexts). The issue is fixed in version 2.27.0.
📍 영향받는 시스템
PDM (Python package and dependency manager) version 2.26.9 and below
⚔️ 공격 벡터
공격자가 조작된 .pdm-plugins 디렉토리와 .pth 파일을 포함한 저장소를 배포하여 사용자가 이를 체크아웃하고 PDM 명령어를 실행하도록 유도
🛡️ 대응 방법
PDM 버전을 2.27.0 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 버전 번호가 2.27.0 미만(예: 2.26.9)이면 취약한 상태입니다.
pdm --version 2>/dev/null | grep -E 'pdm [0-9]+\.[0-9]+\.[0-9]+'