Vulnerability · Published Jan 14, 2025 · Assigned by GitHub_M

CVE-2024-50349Git does not sanitize URLs when asking for credentials interactively

Low 2.1

In plain English

A low-severity security flaw in git from git. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.7% (higher than 51% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 4.0)2.1Low
Exploit odds (30 days)0.7%top 48.5% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals. When Git asks for credentials via a terminal prompt (i.e. without using any credential helper), it prints out the host name for which the user is expected to provide a username and/or a password. At this stage, any URL-encoded parts have been decoded already, and are printed verbatim. This allows attackers to craft URLs that contain ANSI escape sequences that the terminal interpret to confuse users e.g. into providing passwords for trusted Git hosting sites when in fact they are then sent to untrusted sites that are under the attacker's control. This issue has been patch via commits `7725b81` and `c903985` which are included in release versions v2.48.1, v2.47.2, v2.46.3, v2.45.3, v2.44.3, v2.43.6, v2.42.4, v2.41.3, and v2.40.4. Users are advised to upgrade. Users unable to upgrade should avoid cloning from untrusted URLs, especially recursive clones.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
AlmaLinux:8git2.43.7-1.el8_10ALSA-2025:11534
AlmaLinux:9git2.47.3-1.el9_6ALSA-2025:11462
AlmaLinux:10git-all2.47.3-1.el10_0ALSA-2025:11533
AlmaLinux:8git-all2.43.7-1.el8_10ALSA-2025:11534
AlmaLinux:9git-all2.47.3-1.el9_6ALSA-2025:11462
AlmaLinux:8git-core2.43.7-1.el8_10ALSA-2025:11534
AlmaLinux:9git-core2.47.3-1.el9_6ALSA-2025:11462
AlmaLinux:10git-core-doc2.47.3-1.el10_0ALSA-2025:11533
AlmaLinux:8git-core-doc2.43.7-1.el8_10ALSA-2025:11534
AlmaLinux:9git-core-doc2.47.3-1.el9_6ALSA-2025:11462
AlmaLinux:8git-credential-libsecret2.43.7-1.el8_10ALSA-2025:11534
AlmaLinux:9git-credential-libsecret2.47.3-1.el9_6ALSA-2025:11462
AlmaLinux:8git-daemon2.43.7-1.el8_10ALSA-2025:11534
AlmaLinux:9git-daemon2.47.3-1.el9_6ALSA-2025:11462
AlmaLinux:10git-email2.47.3-1.el10_0ALSA-2025:11533
AlmaLinux:8git-email2.43.7-1.el8_10ALSA-2025:11534
AlmaLinux:9git-email2.47.3-1.el9_6ALSA-2025:11462
AlmaLinux:10git-gui2.47.3-1.el10_0ALSA-2025:11533
AlmaLinux:8git-gui2.43.7-1.el8_10ALSA-2025:11534
AlmaLinux:9git-gui2.47.3-1.el9_6ALSA-2025:11462
AlmaLinux:10git-instaweb2.47.3-1.el10_0ALSA-2025:11533
AlmaLinux:8git-instaweb2.43.7-1.el8_10ALSA-2025:11534
AlmaLinux:9git-instaweb2.47.3-1.el9_6ALSA-2025:11462
AlmaLinux:10git-subtree2.47.3-1.el10_0ALSA-2025:11533
AlmaLinux:8git-subtree2.43.7-1.el8_10ALSA-2025:11534
AlmaLinux:9git-subtree2.47.3-1.el9_6ALSA-2025:11462
AlmaLinux:10git-svn2.47.3-1.el10_0ALSA-2025:11533
AlmaLinux:8git-svn2.43.7-1.el8_10ALSA-2025:11534
AlmaLinux:9git-svn2.47.3-1.el9_6ALSA-2025:11462
AlmaLinux:10gitk2.47.3-1.el10_0ALSA-2025:11533
AlmaLinux:8gitk2.43.7-1.el8_10ALSA-2025:11534
AlmaLinux:9gitk2.47.3-1.el9_6ALSA-2025:11462
AlmaLinux:10gitweb2.47.3-1.el10_0ALSA-2025:11533
AlmaLinux:8gitweb2.43.7-1.el8_10ALSA-2025:11534
AlmaLinux:9gitweb2.47.3-1.el9_6ALSA-2025:11462
AlmaLinux:10perl-Git2.47.3-1.el10_0ALSA-2025:11533
AlmaLinux:8perl-Git2.43.7-1.el8_10ALSA-2025:11534
AlmaLinux:9perl-Git2.47.3-1.el9_6ALSA-2025:11462
AlmaLinux:10perl-Git-SVN2.47.3-1.el10_0ALSA-2025:11533
AlmaLinux:8perl-Git-SVN2.43.7-1.el8_10ALSA-2025:11534
AlmaLinux:9perl-Git-SVN2.47.3-1.el9_6ALSA-2025:11462
Alpine:v3.20git2.45.3-r0ALPINE-CVE-2024-50349
Alpine:v3.21git2.47.2-r0ALPINE-CVE-2024-50349
Alpine:v3.22git2.48.1-r0ALPINE-CVE-2024-50349
Alpine:v3.23git2.48.1-r0ALPINE-CVE-2024-50349
Alpine:v3.24git2.48.1-r0ALPINE-CVE-2024-50349
Debian:12git1:2.39.5-0+deb12u2DSA-5850-1
Debian:12git1:2.39.5-0+deb12u2DEBIAN-CVE-2024-50349
Debian:13git1:2.47.2-0.1DEBIAN-CVE-2024-50349
Debian:14git1:2.47.2-0.1DEBIAN-CVE-2024-50349
Rocky Linux:8git0:2.43.7-1.el8_10RLSA-2025:11534
Rocky Linux:9git0:2.47.3-1.el9_6RLSA-2025:11462
Ubuntu:22.04:LTSgit1:2.34.1-1ubuntu1.12USN-7207-1
Ubuntu:22.04:LTSgit1:2.34.1-1ubuntu1.12UBUNTU-CVE-2024-50349
Ubuntu:24.04:LTSgit1:2.43.0-1ubuntu7.2UBUNTU-CVE-2024-50349
Ubuntu:24.04:LTSgit1:2.43.0-1ubuntu7.2USN-7207-1

Affected products (as reported)

VendorProductVersions
git git <= 2.40.3>= 2.41.0, <= 2.41.2>= 2.42.0, <= 2.42.3>= 2.43.0, <= 2.43.5>= 2.44.0, <= 2.44.2>= 2.45.0, <= 2.45.2>= 2.46.0, <= 2.46.2>= 2.47.0, < 2.47.2

Weakness: CWE-116, CWE-147, CWE-150 · Vector: CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:A/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N

References