🇰🇷 한글 설명
isomorphic-git의 트리 파서(src/models/GitTree.js)가 경로 구분자만 거부하고 단독 '..' 트리 엔트리 이름은 허용합니다. 악성 또는 중간자 공격에 노출된 비-GitHub 원격 저장소에서 clone 또는 checkout 시 중첩된 '..' 엔트리가 작업 트리 루트를 벗어나 공격자가 지정한 상위 경로에 파일을 쓸 수 있으며, 이를 통해 시작 스크립트나 설정 파일을 덮어써 코드 실행으로 이어질 수 있습니다. 1.38.6 버전에서 수정되었습니다.
💡 쉬운 설명
Git 라이브러리가 저장소 안의 특수한 파일 경로를 제대로 검사하지 않아, 악성 저장소를 내려받으면 원래 있어야 할 폴더 밖에 파일이 저장될 수 있습니다. 이 파일이 시스템 설정이나 실행 파일을 덮어쓰면 공격자가 임의의 코드를 실행할 수 있습니다.
🇺🇸 원문 (English)
isomorphic-git is a pure JavaScript implementation of Git for Node.js and browsers. Prior to 1.38.6, isomorphic-git's tree parser in src/models/GitTree.js accepts a standalone .. tree-entry name because it rejects only path separators. During clone or checkout from a malicious or man-in-the-middle-controlled non-GitHub remote, nested .. entries can escape the working-tree root and write files at attacker-selected parent paths on any host-backed fs provider. The arbitrary file write can overwrite startup or configuration files and lead to code execution. GitHub-hosted trees are not a direct source because GitHub rejects .. entries during repository integrity checks. This issue is fixed in version 1.38.6.
📍 영향받는 시스템
isomorphic-git 1.38.6 미만 버전을 사용하는 Node.js 및 브라우저 애플리케이션
⚔️ 공격 벡터
악성 또는 중간자 공격 환경의 비-GitHub 원격 저장소에서 clone/checkout 시 '..' 트리 엔트리를 통해 임의 경로에 파일 쓰기
🛡️ 대응 방법
isomorphic-git을 1.38.6 이상으로 업그레이드하고, 신뢰할 수 없는 원격 저장소의 clone/checkout을 제한합니다.
🔧 검증 코드
출력된 버전이 1.38.6 미만이면 취약하므로 업그레이드가 필요하고, 1.38.6 이상이면 수정된 버전입니다.
npm ls isomorphic-git 2>/dev/null | grep isomorphic-git