🇰🇷 한글 설명
Windows용 Git(Git for Windows)에서 설치 프로그램에 현지화 메시지가 포함되지 않음에도, MINGW 패키지 변경으로 인해 gettext()가 런타임 경로 대신 하드코딩된 C:\mingw64\share\locale 경로에서 번역 파일을 찾습니다. 일반 사용자가 C:\ 아래에 폴더를 만들 수 있어 저권한 사용자가 가짜 메시지를 배치할 수 있으며, 버전 2.40.1에서 수정되었습니다.
💡 쉬운 설명
Git이 메시지를 표시할 때 잘못된 폴더를 참조하여, 공격자가 그곳에 가짜 메시지를 넣을 수 있는 문제입니다. 사용자가 이를 Git의 정상 메시지로 오인해 악성 사이트로 유도될 수 있습니다.
🇺🇸 원문 (English)
In Git for Windows, the Windows port of Git, no localized messages are shipped with the installer. As a consequence, Git is expected not to localize messages at all, and skips the gettext initialization. However, due to a change in MINGW-packages, the `gettext()` function's implicit initialization no longer uses the runtime prefix but uses the hard-coded path `C:\mingw64\share\locale` to look for localized messages. And since any authenticated user has the permission to create folders in `C:\` (and since `C:\mingw64` does not typically exist), it is possible for low-privilege users to place fake messages in that location where `git.exe` will pick them up in version 2.40.1.
This vulnerability is relatively hard to exploit and requires social engineering. For example, a legitimate message at the end of a clone could be maliciously modified to ask the user to direct their web browser to a malicious website, and the user might think that the message comes from Git and is legitimate. It does require local write access by the attacker, though, which makes this attack vector less likely. Version 2.40.1 contains a patch for this issue. Some workarounds are available. Do not work on a Windows machine with shared accounts, or alternatively create a `C:\mingw64` folder and leave it empty. Users who have administrative rights may remove the permission to create folders in `C:\`.
📍 영향받는 시스템
Git for Windows 2.40.1 이전 버전
⚔️ 공격 벡터
로컬 쓰기 권한을 가진 공격자가 C:\mingw64\share\locale에 악성 번역 메시지를 배치하고 사회공학적 방법으로 사용자를 속임
🛡️ 대응 방법
Git for Windows를 2.40.1 이상으로 업데이트하거나, C:\mingw64 폴더를 빈 상태로 생성하고 C:\ 폴더 생성 권한을 제거
🔧 검증 코드
출력된 버전이 2.40.1 이상이면 패치가 적용된 것이며, 그보다 낮으면 취약한 버전이므로 업데이트가 필요합니다.
git --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+'