CVE-2023-29007:Git vulnerability allows remote code execution through malicious .gitmodules files with long submodule URLs.

splash
Back

Description Preview

A security vulnerability in Git allows attackers to inject arbitrary configuration into a user's $GIT_DIR/config file when removing configuration sections associated with submodules. The vulnerability occurs when processing specially crafted .gitmodules files containing submodule URLs longer than 1024 characters, which exploits a bug in the git_config_copy_or_rename_section_in_file() function in config.c. By injecting configuration values that specify executables to run (such as core.pager, core.editor, core.sshCommand), attackers can achieve remote code execution when users interact with affected repositories.

Overview

This vulnerability (CVE-2023-29007) affects multiple versions of Git prior to the patched releases. The issue stems from improper handling of long submodule URLs in .gitmodules files, which can be exploited during the execution of 'git submodule deinit' commands. When processing these maliciously crafted files, Git fails to properly sanitize input, allowing attackers to inject malicious configuration directives into the user's Git configuration. Since Git configurations can specify executables to be run during various Git operations, this vulnerability creates a path for remote code execution. This is particularly concerning as Git is widely used for source code management across numerous organizations and development environments.

Remediation

Users should update to the fixed versions of Git as soon as possible. The following versions contain the security patch:

  • 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
  • 2.40.1

If immediate updating is not possible, users should implement the following workaround:

  • Avoid running 'git submodule deinit' on untrusted repositories
  • Carefully inspect any submodule sections in $GIT_DIR/config before performing operations on repositories from untrusted sources
  • Consider using Git security scanning tools to detect potentially malicious repository configurations

References

  1. Git Security Advisory: https://github.com/git/git/security/advisories/GHSA-v48j-4xgg-4844
  2. Git Release Notes: https://github.com/git/git/blob/9ce9dea4e1c2419cca126d29fa7730baa078a11b/Documentation/RelNotes/2.30.9.txt
  3. Fix Commit: https://github.com/git/git/commit/528290f8c61222433a8cf02fb7cfffa8438432b4
  4. Debian Security Advisory: https://lists.debian.org/debian-lts-announce/2024/06/msg00018.html
  5. Fedora Security Advisories:
    • https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PI7FZ4NNR5S5J5K6AMVQBH2JFP6NE4L7/
    • https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/RKOXOAZ42HLXHXTW6JZI4L5DAIYDTYCU/
    • https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/YFZWGQKB6MM5MNF2DLFTD7KS2KWPICKL/
  6. Gentoo Security Advisory: https://security.gentoo.org/glsa/202312-15

Industry ExposureMost to least
This section illustrates the prevalence of a specific Common Vulnerabilities and Exposures (CVE) across various industries based on customer reports. The ranking displays industries from the most to least affected by this particular vulnerability, offering valuable insight into where this CVE has been most frequently observed. This information can help organizations within these sectors prioritize their security efforts, understand their relative risk exposure compared to their peers, and focus remediation strategies where they are most needed. By understanding the industry-specific impact, organizations can make more informed decisions regarding patching, resource allocation, and overall risk management related to this CVE.

  1. Manufacturing
    Manufacturing
  2. Health Care & Social Assistance
    Health Care & Social Assistance
  3. Public Administration
    Public Administration
  4. Finance and Insurance
    Finance and Insurance
  5. Transportation & Warehousing
    Transportation & Warehousing
  6. Educational Services
    Educational Services
  7. Professional, Scientific, & Technical Services
    Professional, Scientific, & Technical Services
  8. Utilities
    Utilities
  9. Other Services (except Public Administration)
    Other Services (except Public Administration)
  10. Retail Trade
    Retail Trade
  11. Arts, Entertainment & Recreation
    Arts, Entertainment & Recreation
  12. Information
    Information
  13. Management of Companies & Enterprises
    Management of Companies & Enterprises
  14. Accommodation & Food Services
    Accommodation & Food Services
  15. Agriculture, Forestry Fishing & Hunting
    Agriculture, Forestry Fishing & Hunting
  16. Mining
    Mining
  17. Construction
    Construction
  18. Real Estate Rental & Leasing
    Real Estate Rental & Leasing
  19. Wholesale Trade
    Wholesale Trade
  20. Administrative, Support, Waste Management & Remediation Services
    Administrative, Support, Waste Management & Remediation Services

Focus on What Matters

  1. See Everything.
  2. Identify True Risk.
  3. Proactively Mitigate Threats.

Let's talk!

background
Armis Vulnerability Intelligence Database