CVE-2021-40330 json
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 c…
published 2021-08-31 5 y ago modified 2026-06-17 4 mo ago also EUVD-2021-27510
- cvss
- 7.5
- version 3.1, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 2.9%
- EPSS 2.9% chance of exploitation in 30 days, percentile 86%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- git-scm git 2.30.1
- git Debian 14, Debian 13, Debian 12 1:2.30.1-1
debian advisories DEBIAN-CVE-2021-40330
- git Ubuntu 18.04 LTS 1:2.17.1-1ubuntu0.9
- git Ubuntu 20.04 LTS 1:2.25.1-1ubuntu3.2
- git Ubuntu Pro 16.04 LTS 1:2.7.4-0ubuntu1.10+esm1
ubuntu advisories UBUNTU-CVE-2021-40330
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- git SLES for SAP 12 SP5, SLES 12 SP5, SLE Software Development Kit 12 SP5 +2 more 2.26.2-27.49.3
- git SLE Module for Development Tools 15 SP2, SLE Module for Basesystem 15 SP2 2.26.2-33.1
suse advisories SUSE-SU-2021:3484-1SUSE-SU-2021:3300-1
- git openSUSE Leap 15.2 2.26.2-lp152.2.12.1
- git openSUSE Leap 15.3 2.26.2-33.1
opensuse advisories openSUSE-SU-2021:1345-1openSUSE-SU-2021:3300-1
- git Alpine 3.12 2.26.3-r1
alpine advisories ALPINE-CVE-2021-40330
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2021-40330 updated cvss 7.5
git: unexpected cross-protocol requests via a repository path containing a newline character
-
Red Hat Enterprise Linux 7 git, gitk, git-hg, git-p4, gitweb, git-all, +12 moreaffected: no fix planned “Out of support scope”
-
Red Hat Software Collections rh-git227-git, rh-git227-gitk, rh-git227-git-p4, rh-git227-gitweb, rh-git227-git-all, rh-git227-git-cvs, +10 moreaffected: no fix planned “Will not fix”
-
Red Hat Enterprise Linux 8 git, gitk, gitweb, git-all, git-gui, git-svn, +8 more Red Hat Enterprise Linux 9 git, gitk, gitweb, git-all, git-gui, git-svn, +8 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Exploit prediction
2.87% chance of exploitation in the next 30 days, higher than 86% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- github.com https://github.com/git/git/commit/a02ea577174ab8ed18f847cf1693f213e0b9c473 referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| NVD | 2.0 | 5.0 | AV:N/AC:L/Au:N/C:P/I:N/A:N |
References
-
github.com
/git/git/commit/a02ea577174ab8ed18f847cf1693f213e0b9c473
exploit, patch, third-party-advisory
-
github.com
/git/git/compare/v2.30.0...v2.30.1
patch, third-party-advisory
-
lists.debian.org
/debian-lts-announce/2022/10/msg00014.html
mailing-list, third-party-advisory
Sources
- CVE List CVE-2021-40330
- NVD CVE-2021-40330
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.