GHSA-v48j-4xgg-4844: Arbitrary configuration injection via `git submodule deinit`

Published Apr 25, 2023
·
Updated

Git is a revision control system. Prior to 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, a specially crafted .gitmodules file with submodule URLs that are longer than 1024 characters can used to exploit a bug in config.c::gitconfigcopyorrenamesectioninfile(). This bug can be used to inject arbitrary configuration into a user's $GITDIR/config when attempting to remove the configuration section associated with that submodule. When the attacker injects configuration values which specify executables to run (such as core.pager, core.editor, core.sshCommand, etc.) this can lead to a remote code execution. A fix A 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. As a workaround, avoid running git submodule deinit on untrusted repositories or without prior inspection of any submodule sections in $GITDIR/config.

Affected Software

1 affected component
Git Git<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

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Git to a version that resolves this vulnerability.

    Fixed in 2.30.9
  2. Upgrade

    Upgrade Git to a version that resolves this vulnerability.

    Fixed in 2.31.8
  3. Upgrade

    Upgrade Git to a version that resolves this vulnerability.

    Fixed in 2.32.7
  4. Upgrade

    Upgrade Git to a version that resolves this vulnerability.

    Fixed in 2.33.8
  5. Upgrade

    Upgrade Git to a version that resolves this vulnerability.

    Fixed in 2.34.8
  6. Upgrade

    Upgrade Git to a version that resolves this vulnerability.

    Fixed in 2.35.8
  7. Upgrade

    Upgrade Git to a version that resolves this vulnerability.

    Fixed in 2.36.6
  8. Upgrade

    Upgrade Git to a version that resolves this vulnerability.

    Fixed in 2.37.7
  9. Upgrade

    Upgrade Git to a version that resolves this vulnerability.

    Fixed in 2.38.5
  10. Upgrade

    Upgrade Git to a version that resolves this vulnerability.

    Fixed in 2.39.3
  11. Upgrade

    Upgrade Git to a version that resolves this vulnerability.

    Fixed in 2.40.1
  12. Compensating control

    Avoid running git submodule deinit on untrusted repositories or without prior inspection of submodule sections in $GIT_DIR/config.

Event History

Apr 25, 2023
CVE Published
via OSV·08:09 PM
Data Sourced
via OSV·08:09 PM
DescriptionSeverityWeakness

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203