CVE-2023-29007
vulnerability analysis and mitigation

Overview

CVE-2023-29007 affects Git, a distributed revision control system. The vulnerability was discovered by André Baptista and Vítor Pinho of Ethiack and disclosed in April 2023. The issue affects Git versions prior to 2.30.9, 2.31.8, 2.32.7, 2.33.8, 2.34.8, 2.35.8, 2.36.6, 2.37.7, 2.38.5, 2.39.3, and 2.40.1. The vulnerability involves a specially crafted .gitmodules file with submodule URLs longer than 1024 characters that can exploit a bug in config.c::git_config_copy_or_rename_section_in_file() (GitHub Advisory, NVD).

Technical details

The vulnerability exists in the function responsible for renaming or deleting existing configuration sections in-place. When processing submodule URLs longer than 1024 characters, the system can improperly treat configuration values as the beginning of new sections. This occurs specifically in the git_config_copy_or_rename_section_in_file() function. The vulnerability has been assigned a CVSS v3.1 base score of 7.8 (HIGH) by NVD and 7.0 (HIGH) by GitHub, with the vector string CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H (NVD, GitHub Advisory).

Impact

When exploited, this vulnerability can be used to inject arbitrary configuration into a user's $GIT_DIR/config when attempting to remove the configuration section associated with that submodule. The attacker can inject configuration values which specify executables to run (such as core.pager, core.editor, core.sshCommand, etc.), potentially leading to remote code execution (GitHub Advisory).

Mitigation and workarounds

As a workaround, users should avoid running git submodule deinit on untrusted repositories or without prior inspection of any submodule sections in $GIT_DIR/config. The permanent fix is available in versions 2.30.9, 2.31.8, 2.32.7, 2.33.8, 2.34.8, 2.35.8, 2.36.6, 2.37.7, 2.38.5, 2.39.3, and 2.40.1 (NVD, GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management