Arbitrary Command Execution Vulnerability in Git Package
Summary
ALPINE-CVE-2019-19604: Arbitrary command execution is possible in Git before 2.20.2, 2.21.x before 2.21.1, 2.22.x before 2.22.2, 2.23.x before 2.23.1, and 2.24.x before 2.24.1 because a "git submodule update" operation can run commands found i... Affects git versions < 2.22.2-r0. Fixed in 2.22.2-r0. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
Git is a widely used version control system that allows developers to track changes in their code and collaborate on projects. It is known for its speed, efficiency, and support for non-linear development workflows. However, certain versions of Git are vulnerable to an arbitrary command execution issue, which can be exploited through malicious repositories.
Vulnerability Detail
The vulnerability arises from the way Git handles the '.gitmodules' file during a 'git submodule update' operation. If a repository contains malicious entries in this file, it can lead to the execution of arbitrary commands on the user's system. This issue affects Git versions prior to 2.20.2, 2.21.x before 2.21.1, 2.22.x before 2.22.2, 2.23.x before 2.23.1, and 2.24.x before 2.24.1. The potential ramifications include unauthorized access to system resources and data, making it a significant security concern.
How To Fix
Minimum fixed version
2.22.2-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
As a temporary workaround, avoid using 'git submodule update' on repositories from untrusted sources. Always review the contents of the '.gitmodules' file before executing any commands that may trigger submodule updates.
Conclusion
The arbitrary command execution vulnerability in Git poses a significant risk to users, especially when interacting with untrusted repositories. It is crucial to update to the latest patched versions of Git to mitigate this risk and ensure the security of your development environment.
See every vulnerability recorded for git →
FAQ
The CVSS score of this vulnerability is 7.8, indicating a high severity level.
Git versions before 2.20.2, 2.21.x before 2.21.1, 2.22.x before 2.22.2, 2.23.x before 2.23.1, and 2.24.x before 2.24.1 are affected.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software using just a manifest file. Visit Vulert Scanner to check if your application is affected.
If you cannot update Git immediately, avoid executing commands from untrusted repositories and review the '.gitmodules' file carefully.
Yes, using tools like Vulert allows you to automate the monitoring of open-source vulnerabilities without requiring access to the code or installation.
References
Related vulnerabilities
Recent vulnerabilities recorded for git.