🇰🇷 한글 설명
libgit2 라이브러리에서 .gitmodules 파일에 포함된 서브모듈 경로의 탐색 구성 요소를 적절히 거부하지 않는 취약점이 발견되었습니다. 공격자가 조작된 저장소를 통해 ../와 같은 경로를 지정하면, 서브모듈을 초기화하는 애플리케이션이 저장소 작업 트리 외부의 디렉토리를 생성할 수 있습니다.
💡 쉬운 설명
악의적으로 만들어진 Git 저장소를 사용하면, 프로그램이 원래 허용된 폴더 범위를 벗어나 컴퓨터의 엉뚱한 곳에 폴더를 만들 수 있는 문제입니다. 이를 통해 시스템의 중요한 파일이 있는 위치에 원치 않는 파일이 생성될 위험이 있습니다.
🇺🇸 원문 (English)
libgit2 is a portable C implementation of the Git core methods provided as a linkable library with a solid API, allowing to build Git functionality into your application. Prior to 1.8.6 and 1.9.5, libgit2 does not reject traversal components in a submodule path loaded from .gitmodules. The affected src/libgit2/submodule.c paths include git_submodule_lookup and git_submodule_add_setup. A crafted repository can specify a path such as ../escape-target, and applications that initialize the submodule can create directories outside the repository working tree. This issue is fixed in versions 1.8.6 and 1.9.5.
📍 영향받는 시스템
libgit2 versions prior to 1.8.6 and 1.9.5
⚔️ 공격 벡터
조작된 .gitmodules 파일을 포함한 저장소를 사용하여 서브모듈 초기화 시 경로 탐색(Path Traversal) 유도
🛡️ 대응 방법
libgit2를 버전 1.8.6 또는 1.9.5 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 libgit2의 버전이 1.8.6 또는 1.9.5보다 낮은지 확인하십시오.
git --version 2>/dev/null || pkg-config --modversion libgit2 2>/dev/null