{"id":"CVE-2024-50349","summary":"Git does not sanitize URLs when asking for credentials interactively","details":"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.","aliases":["BIT-git-2024-50349","GHSA-hmg8-h7qf-7cxr"],"modified":"2026-08-12T15:15:41.054715Z","published":"2025-01-14T18:43:42.620Z","related":["ALSA-2025:11462","ALSA-2025:11533","ALSA-2025:11534","CGA-mr46-mwjg-fvq8","SUSE-RU-2025:20362-1","SUSE-SU-2025:0116-1","SUSE-SU-2025:0144-1","SUSE-SU-2025:0197-1","SUSE-SU-2025:20197-1","SUSE-SU-2025:20721-1","openSUSE-SU-2025:14652-1"],"database_specific":{"cna_assigner":"GitHub_M","cwe_ids":["CWE-116","CWE-147","CWE-150"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/50xxx/CVE-2024-50349.json"},"references":[{"type":"WEB","url":"https://lists.debian.org/debian-lts-announce/2025/01/msg00025.html"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/50xxx/CVE-2024-50349.json"},{"type":"ADVISORY","url":"https://github.com/git/git/security/advisories/GHSA-hmg8-h7qf-7cxr"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-50349"},{"type":"FIX","url":"https://github.com/git/git/commit/7725b8100ffbbff2750ee4d61a0fcc1f53a086e8"},{"type":"FIX","url":"https://github.com/git/git/commit/c903985bf7e772e2d08275c1a95c8a55ab011577"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/git/git","events":[{"introduced":"0"},{"fixed":"54a3711a9dd968a04249beef157393d64b579d64"},{"introduced":"fe86abd7511a9a6862d5706c6fa1d9b57a63ba09"},{"fixed":"6fd641a521a722e438b291ec7b852b7bb508b18b"},{"introduced":"43c8a30d150ecede9709c1f2527c8fba92c65f40"},{"fixed":"54ddf17f827969c989576f2411d9ff519fa8091f"},{"introduced":"564d0252ca632e0264ed670534a51d18a689ef5d"},{"fixed":"664d4fa692cb8637a7c9297c94abf0de8593e585"},{"introduced":"2f323bb16219c105e0c576ea4c2ece9863f5d926"},{"fixed":"2f323bb16219c105e0c576ea4c2ece9863f5d926"},{"introduced":"fc16eb306c2ad25c080612ae85fdeba1fbcbfc98"},{"fixed":"fc16eb306c2ad25c080612ae85fdeba1fbcbfc98"},{"introduced":"5c21db3a0d5f4414b65e114ca21c5a1fe736f2bc"},{"fixed":"5c21db3a0d5f4414b65e114ca21c5a1fe736f2bc"},{"introduced":"777489f9e09c8d0dd6b12f9d90de6376330577a2"},{"fixed":"e1fbebe347426ef7974dc2198f8a277b7c31c8fe"},{"introduced":"fbe8d3079d4a96aeb4e4529cc93cc0043b759a05"},{"fixed":"7725b8100ffbbff2750ee4d61a0fcc1f53a086e8"},{"fixed":"c903985bf7e772e2d08275c1a95c8a55ab011577"}],"database_specific":{"cpe":["cpe:2.3:a:git:git:*:*:*:*:*:*:*:*","cpe:2.3:a:git:git:2.48.0:*:*:*:*:*:*:*"],"extracted_events":[{"introduced":"0"},{"fixed":"2.40.4"},{"introduced":"2.41.0"},{"fixed":"2.41.3"},{"introduced":"2.42.0"},{"fixed":"2.42.4"},{"introduced":"2.43.0"},{"fixed":"2.43.6"},{"introduced":"2.44.3"},{"fixed":"2.44.3"},{"introduced":"2.45.3"},{"fixed":"2.45.3"},{"introduced":"2.46.3"},{"fixed":"2.46.3"},{"introduced":"2.47.0"},{"fixed":"2.47.2"},{"introduced":"2.48.0"},{"last_affected":"2.48.0"}],"source":["CPE_RANGE","CPE_STRING","REFERENCES"]}}],"versions":["2.48.0","= 2.48.0","v2.33.0","v2.47.0","v2.47.1","v2.46.0","v2.46.2","v2.40.3","v2.44.2","v2.43.5","v2.42.3","v2.41.2","v2.46.0-rc2","v2.46.1","v2.46.0-rc0","v2.46.0-rc1","v2.45.0","v2.43.0","v2.44.0","v2.45.2","v2.42.1","v2.45.1","v2.44.1","v2.43.4","v2.42.2","v2.41.1","v2.40.2","v2.43.3","v2.40.1","v2.45.0-rc0","v2.45.0-rc1","v2.44.0-rc2","v2.43.2","v2.44.0-rc1","v2.42.0","v2.44.0-rc0","v2.43.1","v2.41.0","v2.40.0","v2.39.0-rc0","v2.40.0-rc2","v2.40.0-rc1","v2.40.0-rc0","v2.39.0","v2.39.0-rc1","v2.39.0-rc2","v2.38.0","v2.38.0-rc2","v2.38.0-rc1","v2.38.0-rc0","v2.37.0-rc0","v2.37.0","v2.36.0","v2.37.0-rc2","v2.37.0-rc1","v2.36.0-rc2","v2.36.0-rc1","v2.36.0-rc0","v2.32.0","v2.34.0","v2.35.0","v2.35.0-rc2","v2.35.0-rc1","v2.35.0-rc0","v2.30.0","v2.34.0-rc2","v2.34.0-rc1","v2.34.0-rc0","v2.33.0-rc1","v2.33.0-rc2","v2.33.0-rc0","v2.31.0","v2.32.0-rc3","v2.32.0-rc2","v2.32.0-rc1","v2.32.0-rc0","v2.31.0-rc2","v2.31.0-rc1","v2.31.0-rc0","v2.28.0","v2.27.0","v2.30.0-rc1","v2.30.0-rc2","v2.30.0-rc0","v2.29.0","v2.29.0-rc2","v2.29.0-rc1","v2.29.0-rc0","v2.28.0-rc1","v2.28.0-rc2","v2.26.0","v2.28.0-rc0","v2.27.0-rc2","v2.27.0-rc0","v2.27.0-rc1","v2.25.0","v2.24.0","v2.26.0-rc2","v2.26.0-rc1","v2.26.0-rc0","v2.25.0-rc2","v2.25.0-rc1","v2.25.0-rc0","v2.22.0","v2.23.0","v2.21.0","v2.24.0-rc1","v2.24.0-rc2","v2.24.0-rc0","v2.23.0-rc2","v2.23.0-rc1","v2.23.0-rc0","v2.22.0-rc3","v2.22.0-rc2","v2.22.0-rc1","v2.22.0-rc0","v2.20.0","v2.21.0-rc2","v2.21.0-rc1","v2.15.0","v2.21.0-rc0","v2.17.0","v2.18.0","v2.20.0-rc2","v2.20.0-rc1","v2.20.0-rc0","v2.19.0","v2.19.0-rc2","v2.19.0-rc1","v2.19.0-rc0","v2.18.0-rc2","v2.18.0-rc1","v2.18.0-rc0","v2.17.0-rc2","v2.17.0-rc1","v2.17.0-rc0","v2.16.0-rc0","v2.16.0","v2.16.0-rc1","v2.16.0-rc2","v2.15.0-rc2","v2.15.0-rc1","v2.15.0-rc0","v2.14.0","v2.14.0-rc1","v2.11.0","v2.12.0","v2.13.0","v2.14.0-rc0","v2.13.0-rc2","v2.13.0-rc1","v2.13.0-rc0","v2.10.0","v2.12.0-rc2","v2.12.0-rc1","v2.12.0-rc0","v2.11.0-rc3","v2.9.0","v2.11.0-rc2","v2.11.0-rc1","v2.11.0-rc0","v2.10.0-rc2","v2.10.0-rc1","v2.10.0-rc0","v2.7.0","v2.9.0-rc2","v2.8.0","v2.9.0-rc1","v2.9.0-rc0","v2.8.0-rc4","v2.8.0-rc1","v2.8.0-rc3","v2.8.0-rc2","v2.8.0-rc0","v2.6.0","v2.7.0-rc3","v2.4.0","v2.7.0-rc1","v2.7.0-rc2","v2.0.0","v2.7.0-rc0","v2.6.0-rc1","v2.6.0-rc3","v2.6.0-rc2","v2.5.0","v2.6.0-rc0","v2.2.0","v2.5.0-rc3","v2.5.0-rc0","v2.5.0-rc2","v2.5.0-rc1","v2.4.0-rc0","v2.4.0-rc3","v2.4.0-rc2","v2.4.0-rc1","v2.3.0","v2.3.0-rc2","v2.3.0-rc1","v2.3.0-rc0","v1.8.5","v2.2.0-rc1","v2.2.0-rc3","v2.2.0-rc2","v2.1.0","v2.2.0-rc0","v2.1.0-rc2","v2.1.0-rc1","v2.1.0-rc0","v1.9.0","v2.0.0-rc2","v2.0.0-rc4","v2.0.0-rc3","v2.0.0-rc1","v2.0.0-rc0","v1.9-rc0","v1.9.0-rc3","v1.9-rc2","v1.9-rc1","v1.8.5-rc3","v1.8.5-rc2","v1.8.5-rc0","v1.8.5-rc1","v1.8.4","v1.8.3","v1.8.4-rc4","v1.8.4-rc3","v1.8.4-rc2","v1.8.4-rc1","v1.8.4-rc0","v1.8.2","v1.8.1","v1.7.11","v1.8.3-rc0","v1.8.3-rc3","v1.8.3-rc2","v1.8.3-rc1","v1.8.2-rc3","v1.8.2-rc2","v1.8.2-rc1","v1.8.2-rc0","v1.8.0","v1.8.1-rc2","v1.8.1-rc3","v1.7.12","v1.7.9","v1.8.1-rc1","v1.8.1-rc0","v1.8.0-rc3","v1.8.0-rc2","v1.8.0-rc1","v1.8.0-rc0","v1.7.3","v1.7.12-rc3","v1.7.12-rc2","v1.7.11-rc1","v1.7.12-rc1","v1.7.12-rc0","v1.7.11-rc3","v1.7.11-rc0","v1.7.11-rc2","v1.7.10","v1.7.8","v1.7.10-rc3","v1.7.10-rc4","v1.7.10-rc2","v1.7.10-rc1","v1.7.10-rc0","v1.7.7","v1.7.9-rc2","v1.7.9-rc1","v1.7.9-rc0","v1.7.4","v1.7.5","v1.7.8-rc2","v1.7.8-rc4","v1.7.8-rc3","v1.7.0","v1.7.8-rc1","v1.7.6","v1.7.8-rc0","v1.7.7-rc1","v1.7.7-rc3","v1.7.7-rc2","v1.7.7-rc0","v1.6.0","v1.7.6-rc3","v1.7.6-rc2","v1.7.2-rc1","v1.7.6-rc1","v1.7.6-rc0","v1.6.6","v1.7.5-rc3","v1.7.5-rc2","v1.7.5-rc1","v1.7.5-rc0","v1.7.4-rc1","v1.7.4-rc3","v1.7.4-rc2","v1.7.4-rc0","v1.7.1","v1.7.3.1","v1.7.3-rc2","v1.7.3-rc1","v1.7.3-rc0","v1.7.2","v1.7.2-rc3","v1.7.2-rc2","v1.7.2-rc0","v1.7.1-rc2","v1.7.1-rc1","v1.7.1-rc0","v1.7.0-rc2","v1.6.3","v1.6.5","v1.7.0-rc1","v1.7.0-rc0","v1.6.6-rc1","v1.6.1-rc1","v1.6.6-rc4","v1.6.6-rc3","v1.6.6-rc2","v1.6.6-rc0","v1.6.5-rc3","v1.6.5-rc2","v1.6.5-rc1","v1.6.5-rc0","v1.6.4","v1.6.4-rc3","v1.6.4-rc2","v1.6.4-rc1","v1.6.4-rc0","v1.6.2","v1.6.3-rc4","v1.6.3-rc3","v1.6.3-rc2","v1.6.3-rc1","v1.6.3-rc0","v1.6.1","v1.6.2-rc2","v1.6.2-rc1","v1.6.2-rc0","v1.6.1-rc4","v1.6.1-rc3","v1.6.1-rc2","v1.6.0-rc3","v1.6.0-rc2","v1.6.0-rc1","v1.6.0-rc0","v1.5.6","v1.5.6-rc3","v1.5.6-rc2","v1.5.6-rc1","v1.5.6-rc0","v1.5.5","v1.5.5-rc3","v1.5.5-rc2","v1.5.5-rc1","v1.5.5-rc0","v1.5.4","v1.5.4-rc5","v1.5.4-rc4","v1.5.4-rc3","v1.5.4-rc2","v1.5.4-rc1","v1.5.4-rc0","v1.5.3.1","v1.5.3","v1.5.3-rc7","v1.5.3-rc6","v1.5.3-rc5","v1.5.3-rc4","v1.5.3-rc3","v1.5.3-rc2","v1.5.3-rc1","v1.5.3-rc0","v1.5.2","v1.5.2-rc3","v1.5.2-rc2","v1.5.2-rc1","v1.5.2-rc0","v1.5.1","v1.5.1-rc3","v1.5.1-rc2","v1.5.1-rc1","v1.5.0","v1.5.0-rc4","v1.5.0-rc3","v1.5.0-rc2","v1.5.0-rc1","v1.5.0-rc0","v1.4.4.1","v1.4.4","v1.4.4-rc2","v1.4.4-rc1","v1.4.3","v1.4.3-rc3","v1.4.3-rc2","v1.4.3-rc1","v1.4.2","v1.4.2-rc4","v1.4.2-rc3","v1.4.2-rc2","v1.4.2-rc1","v1.4.1","v1.4.1-rc2","v1.4.1-rc1","v1.3.0-rc1","v1.2.0","v1.1.0","v1.0.0","v1.0rc6","v0.99.9n","v1.0rc5","v0.99.9m","v1.0rc4","v0.99.9l","v0.99.9k","v1.0rc3","v0.99.9j","v1.0rc2","v0.99.9i","v1.0rc1","v0.99.9h","v0.99.9g","v0.99.9f","v0.99.9e","v0.99.9d","v0.99.9c","v0.99.9b","v0.99.9a","v0.99.8g","v0.99.8f","v0.99.8e","v0.99.8d","v0.99.8c","v0.99.8b","v0.99.8a","v0.99.8","v0.99.7","v0.99.6","v0.99.5","v0.99.4","v0.99.3","v0.99.2","v0.99.1","v0.99"],"database_specific":{"vanir_signatures":[{"signature_type":"Function","signature_version":"v1","source":"https://github.com/git/git/commit/7725b8100ffbbff2750ee4d61a0fcc1f53a086e8","target":{"file":"credential.c","function":"credential_ask_one"},"deprecated":false,"digest":{"function_hash":"106184299302545319241354038690615792480","length":402},"id":"CVE-2024-50349-362c4518"},{"deprecated":false,"digest":{"length":439,"function_hash":"53931968304206689825796936795146887"},"id":"CVE-2024-50349-429c3667","signature_type":"Function","signature_version":"v1","source":"https://github.com/git/git/commit/c903985bf7e772e2d08275c1a95c8a55ab011577","target":{"file":"credential.c","function":"credential_format"}},{"deprecated":false,"digest":{"line_hashes":["304042810160937010366253680073737709913","87198646612978268235509053734919338321","112680342686121138786542395936712506502","183949411166410659757581807767005536115","161009650745031315959325051657122526266","180691829381376633443727073412934448748","118696133825207084902526683272502274105","158527700799249532493070411851745531368"],"threshold":0.9},"id":"CVE-2024-50349-4b459c88","signature_type":"Line","signature_version":"v1","source":"https://github.com/git/git/commit/7725b8100ffbbff2750ee4d61a0fcc1f53a086e8","target":{"file":"credential.h"}},{"signature_type":"Line","signature_version":"v1","source":"https://github.com/git/git/commit/c903985bf7e772e2d08275c1a95c8a55ab011577","target":{"file":"strbuf.c"},"deprecated":false,"digest":{"line_hashes":["26147145456440650926568218636404419267","160214457267885541781509645608264351309","6499522717605615726478058850042707635","199452519631330596754562522693937793468"],"threshold":0.9},"id":"CVE-2024-50349-5c124c13"},{"signature_type":"Line","signature_version":"v1","source":"https://github.com/git/git/commit/7725b8100ffbbff2750ee4d61a0fcc1f53a086e8","target":{"file":"credential.c"},"deprecated":false,"digest":{"line_hashes":["156674997839216662616403386460319831165","49022758191502366311142768243032375603","244781591973959674228813956167213826365","144715694622371800066965483525868335133","201173078184415221112114557455923480422","211067916437729029070067212086922193679","335960436000378095884640293527491108592","270308974953557080337502117196401681791"],"threshold":0.9},"id":"CVE-2024-50349-5e931b50"},{"signature_version":"v1","source":"https://github.com/git/git/commit/c903985bf7e772e2d08275c1a95c8a55ab011577","target":{"file":"strbuf.c","function":"strbuf_add_percentencode"},"deprecated":false,"digest":{"function_hash":"131285777860610922996493300327882744210","length":404},"id":"CVE-2024-50349-676487e9","signature_type":"Function"},{"signature_version":"v1","source":"https://github.com/git/git/commit/c903985bf7e772e2d08275c1a95c8a55ab011577","target":{"file":"credential.c"},"deprecated":false,"digest":{"line_hashes":["175720700490352213409672575262767296678","324963513350224233705167728822312917050","185518700226588980421428656795354924009","244496479597714107123226086317002739760"],"threshold":0.9},"id":"CVE-2024-50349-957f9932","signature_type":"Line"},{"signature_version":"v1","source":"https://github.com/git/git/commit/7725b8100ffbbff2750ee4d61a0fcc1f53a086e8","target":{"file":"credential.c","function":"credential_config_callback"},"deprecated":false,"digest":{"function_hash":"8957962033540934532869798794359487900","length":640},"id":"CVE-2024-50349-e31f1de6","signature_type":"Function"}],"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-50349.json","vanir_signatures_modified":"2026-08-12T15:15:41Z"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V4","score":"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"}]}