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": [
{
"last_affected": "10.0"
}
],
"source": "CPE_STRING",
"cpes": [
"cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*"
],
"vendor_product": "debian:debian_linux"
}
]
}{
"cpe": "cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*",
"extracted_events": [
{
"introduced": "0"
},
{
"fixed": "2.30.1"
}
],
"source": "CPE_RANGE"
}{
"cpe": "cpe:2.3:a:git-scm:git:*:*:*:*:*:*:*:*",
"extracted_events": [
{
"introduced": "0"
},
{
"fixed": "2.30.1"
}
],
"source": [
"CPE_RANGE",
"REFERENCES"
]
}[
{
"signature_type": "Function",
"digest": {
"length": 710.0,
"function_hash": "230735358351763402630356967767374818080"
},
"id": "CVE-2021-40330-7f6a1f13",
"deprecated": false,
"signature_version": "v1",
"source": "https://github.com/git/git/commit/a02ea577174ab8ed18f847cf1693f213e0b9c473",
"target": {
"function": "git_connect_git",
"file": "connect.c"
}
},
{
"signature_type": "Line",
"digest": {
"line_hashes": [
"133355785385257712963848992325578550264",
"235724189758691676970782344456206164053",
"193312243769820270394387628664609223536",
"143481889806468762248610901874244410742"
],
"threshold": 0.9
},
"id": "CVE-2021-40330-df968e5b",
"deprecated": false,
"signature_version": "v1",
"source": "https://github.com/git/git/commit/a02ea577174ab8ed18f847cf1693f213e0b9c473",
"target": {
"file": "connect.c"
}
}
]
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2021-40330.json"
"2026-05-30T18:22:25Z"