🔍 CVE-2024-50338

7.4
CVSS Score
HIGH
2025-01-14
2026-06-17 08:04
✅ 완료

🇰🇷 한글 설명

Git Credential Manager의 개행 문자(CR) 처리 방식이 Git과 달라서 발생하는 취약점입니다. 공격자가 악의적인 원격 저장소 URL을 만들어 사용자가 인증할 때 다른 Git 저장소의 자격증명을 탈취할 수 있습니다. --recursive 옵션으로 복제할 때 사용자가 submodule URL을 미리 검증하지 못해 위험도가 높아집니다.

💡 쉬운 설명

Git 암호 관리 프로그램이 개행 문자를 잘못 인식해서 해커가 당신의 인증 정보를 훔칠 수 있습니다. 신뢰할 수 없는 저장소를 복제할 때 특히 위험합니다.

🇺🇸 원문 (English)

Git Credential Manager (GCM) is a secure Git credential helper built on .NET that runs on Windows, macOS, and Linux. The Git credential protocol is text-based over standard input/output, and consists of a series of lines of key-value pairs in the format `key=value`. Git's documentation restricts the use of the NUL (`\0`) character and newlines to form part of the keys or values. When Git reads from standard input, it considers both LF and CRLF as newline characters for the credential protocol by virtue of calling `strbuf_getline` that calls to `strbuf_getdelim_strip_crlf`. Git also validates that a newline is not present in the value by checking for the presence of the line-feed character (LF, `\n`), and errors if this is the case. This captures both LF and CRLF-type newlines. Git Credential Manager uses the .NET standard library `StreamReader` class to read the standard input stream line-by-line and parse the `key=value` credential protocol format. The implementation of the `ReadLineAsync` method considers LF, CRLF, and CR as valid line endings. This is means that .NET considers a single CR as a valid newline character, whereas Git does not. This mismatch of newline treatment between Git and GCM means that an attacker can craft a malicious remote URL. When a user clones or otherwise interacts with a malicious repository that requires authentication, the attacker can capture credentials for another Git remote. The attack is also heightened when cloning from repositories with submodules when using the `--recursive` clone option as the user is not able to inspect the submodule remote URLs beforehand. This issue has been patched in version 2.6.1 and all users are advised to upgrade. Users unable to upgrade should only interact with trusted remote repositories, and not clone with `--recursive` to allow inspection of any submodule URLs before cloning those submodules.

📍 영향받는 시스템

Git Credential Manager 2.6.1 미만 (Windows, macOS, Linux 모두 영향)

⚔️ 공격 벡터

악의적인 원격 저장소 URL을 통해 사용자 인증 시 다른 Git 원격의 자격증명을 탈취

🛡️ 대응 방법

Git Credential Manager를 2.6.1 이상으로 업그레이드하거나, 신뢰할 수 있는 저장소만 사용하고 --recursive 옵션 사용 금지

🔧 검증 코드

출력된 버전이 2.6.1 이상이면 안전하고, 그 미만이면 즉시 업그레이드 필요합니다.

Shell / Script
git-credential-manager --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+'

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N

💻 영향받는 소프트웨어

Git