GIT Vulnerability Fixes/Issues and Other Related Information - [git clone --recursive] vulnerability
When a git repository contains a submodule within it, it's structure is stored alongside it's parents within the .git folder. This structure is normally stored in a folder with the same name as the submodule, but this name is actually able to be configured by the file in the parent repository. This Vulnerability affects versions of git that allow that folder name to contain a path that is not inside the .git directory. Attackers create a parent repository that has another git repository checked in and it can be added inside that parent directory. Then the repository that is checked in can be added as a submodule of the parent repository, this submodule's actual location can be set outside of the .git folder, yet still pointing to the checked in repository of the parent. When you decide to git clone (recursively) the parent repository, this submodule specified location in the .git file will then be followed and executed, along with any malicious hooks added into it.
Code sharing/storing companies such as Github and Gitlab are currently making efforts to block any repository trying to set up a git submodule outside of the .git directory and overall other hosting providers are stepping forward to block these repositories as well. Visual Studio Services is also currently making efforts to block malicious repositories as well!
But still, you cannot assume you are safe with your current version of git.
```
git init test && \
cd test && \
git update-index --add --cacheinfo 120000,e69de29bb2d1d6434b8b29ae775ad8c2e48c5391,.gitmodules
```
Note: this will not clone any repositories, nor will it hurt your current version of git
```
error: Invalid path '.gitmodules'
fatal: git update-index: --cacheinfo cannot add .gitmodules
```
Windows is quite easy to upgrade. Simply grab the newest version of Git for Windows (version 2.17.1) from https://gitforwindows.org/.
Apple ships Git with Xcode but unfortunately, they do not update it regularly, even for security vulnerabilities. So in that case you'll need to upgrade through homebrew.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install git
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bashrc
sudo apt-get update
sudo yum update
sudo apt-get install git
sudo yum update git
git --version