gitconnectgit in connect.c in Git before 2.30.1 allows a repository path to contain a newline character, which may result in unexpected cross-protocol requests, as demonstrated by the git://localhost:1234/%0d%0a%0d%0aGET%20/%20HTTP/1.1 substring.
{
"unresolved_ranges": [
{
"extracted_events": [
{
"introduced": "10.0"
},
{
"last_affected": "10.0"
}
],
"source": "CPE_STRING",
"vendor_product": "debian:debian_linux",
"cpes": [
"cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*"
]
}
]
}{
"source": "CPE_RANGE",
"cpe": "cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*",
"extracted_events": [
{
"introduced": "0"
},
{
"fixed": "2.30.1"
}
]
}{
"source": [
"CPE_RANGE",
"REFERENCES"
],
"cpe": "cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*",
"extracted_events": [
{
"introduced": "0"
},
{
"fixed": "2.30.1"
}
]
}"2026-07-09T00:36:53Z"
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-40330.json"
[
{
"id": "CVE-2021-40330-7f6a1f13",
"digest": {
"function_hash": "230735358351763402630356967767374818080",
"length": 710.0
},
"signature_version": "v1",
"signature_type": "Function",
"source": "https://github.com/git/git/commit/a02ea577174ab8ed18f847cf1693f213e0b9c473",
"deprecated": false,
"target": {
"function": "git_connect_git",
"file": "connect.c"
}
},
{
"id": "CVE-2021-40330-df968e5b",
"digest": {
"line_hashes": [
"133355785385257712963848992325578550264",
"235724189758691676970782344456206164053",
"193312243769820270394387628664609223536",
"143481889806468762248610901874244410742"
],
"threshold": 0.9
},
"signature_version": "v1",
"signature_type": "Line",
"source": "https://github.com/git/git/commit/a02ea577174ab8ed18f847cf1693f213e0b9c473",
"deprecated": false,
"target": {
"file": "connect.c"
}
}
]