# CVE-2021-40330: gitconnectgit in connect.c in Git before 2.30.1 allows a repository path to contain a newline character, which may result in unexpected cro…

- Severity: High 7.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 2.90%, higher than 87% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2021-08-31T00:00:00.000Z
- Modified: 2026-06-17T04:06:44.270Z
- Assigned by: mitre

## Description

git_connect_git 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.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- git-scm git: before 2.30.1
- debian debian_linux: 10.0

## Every score

- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- NVD: CVSS:2.0 5.0 Medium `AV:N/AC:L/Au:N/C:P/I:N/A:N`

## References

- <https://github.com/git/git/commit/a02ea577174ab8ed18f847cf1693f213e0b9c473> (exploit, patch, third-party-advisory)
- <https://github.com/git/git/compare/v2.30.0...v2.30.1> (patch, third-party-advisory)
- <https://lists.debian.org/debian-lts-announce/2022/10/msg00014.html> (mailing-list, third-party-advisory)

## Sources

- CVE List: [CVE-2021-40330](https://www.cve.org/CVERecord?id=CVE-2021-40330), CVE Terms of Use, modified 2024-08-04
- NVD: [CVE-2021-40330](https://nvd.nist.gov/vuln/detail/CVE-2021-40330), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-40330 · Whole record: https://cve.day/CVE-2021-40330.json · Rebuilt by cve.day 2026-11-25T22:58:03.565Z
