CVE-2024-50349
Git does not sanitize URLs when asking for credentials interactively
Reported by github_m · Published January 14, 2025
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| gitweb | Amazon Linux | 2.47.1-1.amzn2023.0.2 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| git | git | <= 2.40.3, >= 2.41.0, <= 2.41.2, >= 2.42.0, <= 2.42.3 |
| amazon:2023 | gitweb | 0 |
| git | git | 2.48.0, 2.47.0, 2.46.0 |
| amazon:2 | git-instaweb | 0 |
| amazon:2 | gitweb | 0 |
| wolfi | git | 0 |
| amazon:2 | git-all | 0 |
| amazon:2023 | git-gui | 0 |
| chainguard | git | 0 |
| amazon:2 | git-subtree | 0 |
| amazon:2 | git-svn | 0 |
| amazon:2023 | git-core | 0 |
| amazon:2023 | git-all | 0 |
| amazon:2 | git-email | 0 |
| amazon:2023 | git-p4 | 0 |
| amazon:2023 | git-instaweb | 0 |
| amazon:2 | gitk | 0 |
| amazon:2 | git | 0 |
| amazon:2 | git-gui | 0 |
| amazon:2023 | perl-Git-SVN | 0 |
…and 19 more
Timeline
- Jan 14, 2025 CVE Published
- Jan 15, 2025 EPSS Score (30 in total, the first dated here)
- Jan 21, 2025 Coalition ESS Score (15 in total, the first dated here)
- Dec 20, 2025 CVE Updated
- Jan 2, 2026 Security Advisory (14 in total, the first dated here)
- Apr 18, 2026 PoC Published
- Oct 23, 2026 Distribution Patch (9 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2024-50349
vulnetix vdb fixes CVE-2024-50349
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-50349/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- https://github.com/git/git/security/advisories/GHSA-hmg8-h7qf-7cxr x_refsource_CONFIRM
- https://github.com/git/git/commit/7725b8100ffbbff2750ee4d61a0fcc1f53a086e8 x_refsource_MISC
- https://github.com/git/git/commit/c903985bf7e772e2d08275c1a95c8a55ab011577 x_refsource_MISC
- https://lists.debian.org/debian-lts-announce/2025/01/msg00025.html advisory