Critical Security Flaw in Git Package: Credential Exposure via Terminal Prompts

git Updated 02 Oct 2025

Summary

14/01/2025
N/A
Yes i
Unrated
Not published

ALPINE-CVE-2024-50349: 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. Affects git versions < 2.40.4-r0. Fixed in 2.40.4-r0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Git is a widely used, fast, and scalable distributed revision control system that provides a rich command set for managing source code. It allows users to track changes, collaborate on projects, and maintain version history. However, a recent vulnerability has been identified that compromises user credentials when interacting with untrusted URLs, posing significant security risks.

Vulnerability Detail

The vulnerability arises when Git prompts users for credentials via a terminal without using a credential helper. During this process, Git prints the hostname for which credentials are required, and any URL-encoded parts are decoded and displayed verbatim. Attackers can exploit this by crafting URLs containing ANSI escape sequences, misleading users into entering their credentials for trusted Git hosting sites, while the credentials are actually sent to malicious sites controlled by the attackers. This flaw has been addressed in several patched versions of Git.

How To Fix

Minimum fixed version

2.40.4-r0

This is the first release that contains the fix.

sudo apk add --upgrade git

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

Until the package can be updated, users are advised to avoid cloning from untrusted URLs, especially when performing recursive clones. This can help mitigate the risk of credential exposure.

Conclusion

The identified vulnerability in the Git package poses a significant risk by exposing user credentials through misleading terminal prompts. Users are strongly encouraged to update their Git installations to the latest patched versions to safeguard against potential attacks. Additionally, exercising caution when interacting with untrusted URLs can help mitigate risks until an upgrade is possible.

See every vulnerability recorded for git →

Share this vulnerability

FAQ

The vulnerability allows attackers to craft misleading URLs that can trick users into providing their credentials for untrusted sites.

Check your Git version using the command 'git --version'. If it is lower than the patched versions listed, it is vulnerable.

Avoid cloning from untrusted URLs and be cautious when entering credentials in the terminal.

Yes, tools like Vulert can monitor your application for open-source vulnerabilities in real-time using just a manifest file.

You can find detailed information about this vulnerability in the CVE database or by visiting the official Git repository.

Related vulnerabilities

Recent vulnerabilities recorded for git.

How To Fix

Minimum fixed version

2.40.4-r0

This is the first release that contains the fix.

sudo apk add --upgrade git

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback