Arbitrary configuration injection via `git submodule deinit`
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::git_config_copy_or_rename_section_in_file()`. This bug 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. 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 `$GIT_DIR/config`.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2023-29007
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 2 Nov 2026, 20:24 UTC · Revision 1
Source evidence
Arbitrary configuration injection via `git submodule deinit`
core-osv · Original sourcePublished 25 Apr 2023, 20:09 UTC
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::git_config_copy_or_rename_section_in_file()`. This bug 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. 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 `$GIT_DIR/config`.
osv:CVE-2023-29007
Complete source record
{
"id": "44aed2935de6af768e5c590b83389d4a962fa066ec7ff65d17b5fc25d453ead0",
"url": "https://osv.dev/vulnerability/CVE-2023-29007",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Arbitrary configuration injection via `git submodule deinit`",
"summary": "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::git_config_copy_or_rename_section_in_file()`. This bug 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. 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 `$GIT_DIR/config`.",
"evidence": "osv:CVE-2023-29007",
"products": [],
"severity": "high",
"structured": {
"id": "CVE-2023-29007",
"aliases": [
"CVE-2023-29007",
"GHSA-v48j-4xgg-4844"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/git-for-windows/git",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "469fcac0990381aa6d656f5b02924482b91e0ce5"
},
{
"introduced": "1d90ca2906dd4b7ddaf0669a13c173ec579d794a"
},
{
"last_affected": "1d90ca2906dd4b7ddaf0669a13c173ec579d794a"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "2.39.0"
},
{
"fixed": "2.39.3"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:git-scm:git:2.40.0:*:*:*:*:*:*:*",
"range": [
{
"introduced": "2.40.0"
},
{
"last_affected": "2.40.0"
}
],
"source": "CPE_STRING"
}
]
}
},
{
"repo": "https://github.com/git/git",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "668f2d53613ac8fd373926ebe219f2c29112d93e"
},
{
"introduced": "a5828ae6b52137b913b978e16cd2334482eb4c1f"
},
{
"fixed": "ea56f91275c1797776f10f4ac5d65671bb4f3e8b"
},
{
"introduced": "ebf3c04b262aa27fbb97f8a0156c2347fecafafb"
},
{
"fixed": "b8787a98dbef7b3b1cec9818b8856de557a65256"
},
{
"introduced": "225bc32a989d7a22fa6addafd4ce7dcd04675dbf"
},
{
"fixed": "3a19048ce498d519bd564c9fd222161dca789321"
},
{
"introduced": "cd3e606211bb1cf8bc57f7d76bab98cc17a150bc"
},
{
"fixed": "abcb63fb70a69956a892fa830f3866098797787c"
},
{
"introduced": "89bece5c8c96f0b962cfc89e63f82d603fd60bed"
},
{
"fixed": "7380a72f6b4da51f6db975f4a37c4ea9dadbf477"
},
{
"introduced": "6cd33dceed60949e2dbc32e3f0f5e67c4c882e1e"
},
{
"fixed": "673472a9635805d3b1fcd0038ecc0a9418078685"
},
{
"introduced": "e4a4b31577c7419497ac30cebe30d755b97752c5"
},
{
"fixed": "d27ae36bbb7512474f759ac61a0581b6bbb36b2f"
},
{
"introduced": "3dcec76d9df911ed8321007b1d197c1a206dc164"
},
{
"fixed": "ec583449067bab5b800ecc63926f35c9dae96fa1"
},
{
"introduced": "c48035d29b4e524aed3a32f0403676f0d9128863"
},
{
"fixed": "9bbde12feed306b9044060e4eab6b3b4c6628050"
},
{
"introduced": "73876f4861cd3d187a4682290ab75c9dccadbc56"
},
{
"fixed": "528290f8c61222433a8cf02fb7cfffa8438432b4"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "0"
},
{
"fixed": "2.30.9"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "2.31.0"
},
{
"fixed": "2.31.8"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "2.32.0"
},
{
"fixed": "2.32.7"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "2.33.0"
},
{
"fixed": "2.33.8"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "2.34.0"
},
{
"fixed": "2.34.8"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "2.35.0"
},
{
"fixed": "2.35.8"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "2.36.0"
},
{
"fixed": "2.36.5"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "2.37.0"
},
{
"fixed": "2.37.7"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "2.38.0"
},
{
"fixed": "2.38.5"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "2.39.0"
},
{
"fixed": "2.39.3"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:git-scm:git:2.40.0:*:*:*:*:*:*:*",
"range": [
{
"introduced": "2.40.0"
},
{
"last_affected": "2.40.0"
}
],
"source": "CPE_STRING"
},
{
"range": [
{
"fixed": "528290f8c61222433a8cf02fb7cfffa8438432b4"
}
],
"source": "REFERENCES_COMMIT"
}
]
}
}
],
"versions": [
"2.40.0",
"v2.39.2.windows.1",
"v2.40.0.windows.1",
"v2.30.0-rc2",
"v2.27.0-rc1",
"v2.21.0",
"v2.22.0-rc0",
"v2.15.0",
"v2.17.0",
"v2.18.0",
"v2.19.0",
"v2.19.0-rc2",
"v2.19.0-rc1",
"v2.19.0-rc0",
"v2.18.0-rc2",
"v2.18.0-rc1",
"v2.18.0-rc0",
"v2.17.0-rc2",
"v2.17.0-rc1",
"v2.17.0-rc0",
"v2.16.0-rc0",
"v2.16.0",
"v2.16.0-rc1",
"v2.16.0-rc2",
"v2.15.0-rc2",
"v2.15.0-rc1",
"v2.15.0-rc0",
"v2.14.0",
"v2.14.0-rc1",
"v2.11.0",
"v2.12.0",
"v2.13.0",
"v2.14.0-rc0",
"v2.13.0-rc2",
"v2.13.0-rc1",
"v2.13.0-rc0",
"v2.10.0",
"v2.12.0-rc2",
"v2.12.0-rc1",
"v2.12.0-rc0",
"v2.11.0-rc3",
"v2.9.0",
"v2.11.0-rc2",
"v2.11.0-rc1",
"v2.11.0-rc0",
"v2.10.0-rc2",
"v2.10.0-rc1",
"v2.10.0-rc0",
"v2.7.0",
"v2.9.0-rc2",
"v2.8.0",
"v2.9.0-rc1",
"v2.9.0-rc0",
"v2.8.0-rc4",
"v2.8.0-rc1",
"v2.8.0-rc3",
"v2.8.0-rc2",
"v2.8.0-rc0",
"v2.6.0",
"v2.7.0-rc3",
"v2.4.0",
"v2.7.0-rc1",
"v2.7.0-rc2",
"v2.0.0",
"v2.7.0-rc0",
"v2.6.0-rc1",
"v2.6.0-rc3",
"v2.6.0-rc2",
"v2.5.0",
"v2.6.0-rc0",
"v2.2.0",
"v2.5.0-rc3",
"v2.5.0-rc0",
"v2.5.0-rc2",
"v2.5.0-rc1",
"v2.4.0-r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c5",
"v1.5.4-rc4",
"v1.5.4-rc3",
"v1.5.4-rc2",
"v1.5.4-rc1",
"v1.5.4-rc0",
"v1.5.3.1",
"v1.5.3",
"v1.5.3-rc7",
"v1.5.3-rc6",
"v1.5.3-rc5",
"v1.5.3-rc4",
"v1.5.3-rc3",
"v1.5.3-rc2",
"v1.5.3-rc1",
"v1.5.3-rc0",
"v1.5.2",
"v1.5.2-rc3",
"v1.5.2-rc2",
"v1.5.2-rc1",
"v1.5.2-rc0",
"v1.5.1",
"v1.5.1-rc3",
"v1.5.1-rc2",
"v1.5.1-rc1",
"v1.5.0",
"v1.5.0-rc4",
"v1.5.0-rc2",
"v1.5.0-rc3",
"v1.5.0-rc1",
"v1.5.0-rc0",
"v1.4.4.1",
"v1.4.4",
"v1.4.4-rc2",
"v1.4.4-rc1",
"v1.4.3",
"v1.4.3-rc3",
"v1.4.3-rc2",
"v1.4.3-rc1",
"v1.4.2",
"v1.4.2-rc4",
"v1.4.2-rc3",
"v1.4.2-rc2",
"v1.4.2-rc1",
"v1.4.1",
"v1.4.1-rc2",
"v1.4.1-rc1",
"v1.3.0-rc1",
"v1.2.0",
"v1.1.0",
"v1.0.0",
"v1.0rc6",
"v0.99.9n",
"v1.0rc5",
"v0.99.9m",
"v1.0rc4",
"v0.99.9l",
"v0.99.9k",
"v1.0rc3",
"v0.99.9j",
"v1.0rc2",
"v0.99.9i",
"v1.0rc1",
"v0.99.9h",
"v0.99.9g",
"v0.99.9f",
"v0.99.9e",
"v0.99.9d",
"v0.99.9c",
"v0.99.9b",
"v0.99.9a",
"v0.99.8g",
"v0.99.8f",
"v0.99.8e",
"v0.99.8d",
"v0.99.8c",
"v0.99.8b",
"v0.99.8a",
"v0.99.8",
"v0.99.7",
"v0.99.6",
"v0.99.5",
"v0.99.4",
"v0.99.3",
"v0.99.2",
"v0.99.1",
"v0.99",
"v2.33.0",
"v2.38.4",
"v2.37.6",
"v2.34.7",
"v2.33.7",
"v2.32.6",
"v2.31.7",
"v2.30.8",
"v2.35.7",
"v2.39.2",
"v2.39.0",
"v2.38.3",
"v2.37.5",
"v2.36.4",
"v2.35.6",
"v2.34.6",
"v2.33.6",
"v2.32.5",
"v2.31.6",
"v2.30.7",
"v2.39.1",
"v2.30.6",
"v2.38.2",
"v2.37.4",
"v2.36.3",
"v2.35.5",
"v2.34.5",
"v2.33.5",
"v2.32.4",
"v2.31.5",
"v2.38.0",
"v2.38.1",
"v2.37.3",
"v2.37.2",
"v2.36.2",
"v2.35.4",
"v2.34.4",
"v2.33.4",
"v2.31.4",
"v2.32.3",
"v2.30.5",
"v2.37.1",
"v2.37.0",
"v2.36.0",
"v2.35.3",
"v2.34.3",
"v2.33.3",
"v2.32.2",
"v2.31.3",
"v2.30.4",
"v2.36.1",
"v2.35.1",
"v2.35.2",
"v2.34.2",
"v2.33.2",
"v2.32.1",
"v2.31.2",
"v2.30.3",
"v2.34.1",
"v2.32.0",
"v2.31.1",
"v2.34.0",
"v2.30.2",
"v2.35.0",
"v2.33.1",
"v2.30.0",
"v2.31.0",
"v2.30.1",
"v2.28.0",
"v2.27.0",
"v2.30.0-rc1",
"v2.30.0-rc0",
"v2.29.0",
"v2.29.0-rc2",
"v2.29.0-rc1",
"v2.29.0-rc0",
"v2.28.0-rc1",
"v2.28.0-rc2",
"v2.26.0",
"v2.28.0-rc0",
"v2.27.0-rc2",
"v2.27.0-rc0",
"v2.25.0",
"v2.24.0",
"v2.26.0-rc2",
"v2.26.0-rc1",
"v2.26.0-rc0",
"v2.25.0-rc2",
"v2.25.0-rc1",
"v2.25.0-rc0",
"v2.22.0",
"v2.23.0",
"v2.24.0-rc1",
"v2.24.0-rc2",
"v2.24.0-rc0",
"v2.23.0-rc2",
"v2.23.0-rc1",
"v2.23.0-rc0",
"v2.22.0-rc3",
"v2.22.0-rc2",
"v2.22.0-rc1",
"v2.20.0",
"v2.21.0-rc2",
"v2.21.0-rc1",
"v2.21.0-rc0",
"v2.20.0-rc2",
"v2.20.0-rc1",
"v2.20.0-rc0"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-29007.json"
}
}
],
"modified": "2026-10-28T02:30:23.389624553Z",
"provider": "osv",
"references": [
"https://github.com/git/git/blob/9ce9dea4e1c2419cca126d29fa7730baa078a11b/Documentation/RelNotes/2.30.9.txt",
"https://lists.debian.org/debian-lts-announce/2024/06/msg00018.html",
"https://lists.debian.org/debian-lts-announce/2024/09/msg00009.html",
"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/",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/29xxx/CVE-2023-29007.json",
"https://github.com/git/git/security/advisories/GHSA-v48j-4xgg-4844",
"https://nvd.nist.gov/vuln/detail/CVE-2023-29007",
"https://security.gentoo.org/glsa/202312-15",
"https://github.com/git/git/commit/528290f8c61222433a8cf02fb7cfffa8438432b4"
],
"provider_metadata": {
"cwe_ids": [
"CWE-74"
],
"cna_assigner": "GitHub_M",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/29xxx/CVE-2023-29007.json"
}
},
"related_cves": [
{
"value": "CVE-2023-29007",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 489819,
"published_at": "2023-04-25T20:09:52.182+00:00"
}