CVE-2022-29187
JSON

7.8high

Bypass of safe.directory protections in Git

Severity
7.8high CVSS:3.1 by GitHub_M
Exploit likelihood
0.45% (higher than 40% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M

Description

Git is a distributed revision control system. Git prior to versions 2.37.1, 2.36.2, 2.35.4, 2.34.4, 2.33.4, 2.32.3, 2.31.4, and 2.30.5, is vulnerable to privilege escalation in all platforms. An unsuspecting user could still be affected by the issue reported in CVE-2022-24765, for example when navigating as root into a shared tmp directory that is owned by them, but where an attacker could create a git repository. Versions 2.37.1, 2.36.2, 2.35.4, 2.34.4, 2.33.4, 2.32.3, 2.31.4, and 2.30.5 contain a patch for this issue. The simplest way to avoid being affected by the exploit described in the example is to avoid running git as root (or an Administrator in Windows), and if needed to reduce its use to a minimum. While a generic workaround is not possible, a system could be hardened from the exploit described in the example by removing any such repository if it exists already and creating one as root to block any future attacks.

Affected

Product or packageVersionsReported by
git git>= 2.30.3, < 2.30.5, >= 2.31.2, < 2.31.4, >= 2.32.1, < 2.32.3, >= 2.33.2, < 2.33.4, >= 2.34.2, < 2.34.4, >= 2.35.2, < 2.35.4, >= 2.36, < 2.36.2, >= 2.37, < 2.37.1CVE List
git-scm gitfrom 2.30.3 before 2.30.5, from 2.31.2 before 2.31.4, from 2.32.1 before 2.32.3, from 2.33.2 before 2.33.4, from 2.34.2 before 2.34.4, from 2.35.2 before 2.35.4, from 2.36.0 before 2.36.2, from 2.37.0 before 2.37.1NVD
fedoraproject fedora35, 36, 37NVD
apple xcodebefore 14.1NVD
debian debian_linux10.0NVD

All scores

GitHub_M7.8high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
NVD7.8high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
NVD6.9medium CVSS:2.0AV:L/AC:M/Au:N/C:C/I:C/A:C

Classification

What each source says

CVE List

Git is a distributed revision control system. Git prior to versions 2.37.1, 2.36.2, 2.35.4, 2.34.4, 2.33.4, 2.32.3, 2.31.4, and 2.30.5, is vulnerable to privilege escalation in all platforms. An unsuspecting user could still be affected by the issue reported in CVE-2022-24765, for example when navigating as root into a shared tmp directory that is owned by them, but where an attacker could create a git repository. Versions 2.37.1, 2.36.2, 2.35.4, 2.34.4, 2.33.4, 2.32.3, 2.31.4, and 2.30.5 contain a patch for this issue. The simplest way to avoid being affected by the exploit described in the example is to avoid running git as root (or an Administrator in Windows), and if needed to reduce its use to a minimum. While a generic workaround is not possible, a system could be hardened from the exploit described in the example by removing any such repository if it exists already and creating one as root to block any future attacks.

NVD (es)

Git es un sistema de control de revisión distribuido. Git versiones anteriores a 2.37.1, 2.36.2, 2.35.4, 2.34.4, 2.33.4, 2.32.3, 2.31.4 y 2.30.5, es vulnerable a la escalada de privilegios en todas las plataformas. Un usuario desprevenido aún podría verse afectado por el problema reportado en CVE-2022-24765, por ejemplo cuando navega como root en un directorio tmp compartido que es de su propiedad, pero donde un atacante podría crear un repositorio git. Las versiones 2.37.1, 2.36.2, 2.35.4, 2.34.4, 2.33.4, 2.32.3, 2.31.4 y 2.30.5 contienen un parche para este problema. La forma más sencilla de evitar ser afectado por la explotación descrita en el ejemplo es evitar ejecutar git como root (o como administrador en Windows), y si es necesario reducir su uso al mínimo. Aunque no es posible una mitigación genérica, un sistema puede ser reforzado contra la explotación descrito en el ejemplo eliminando cualquier repositorio de este tipo si ya se presenta y creando uno como root para bloquear cualquier ataque futuro

References

https://github.com/git/git/security/advisories/GHSA-j342-m5hw-rr3vthird-party-advisory
https://github.blog/2022-04-12-git-security-vulnerability-announcedthird-party-advisory
https://lore.kernel.org/git/xmqqv8s2fefi.fsf%40gitster.g/T/#u
http://www.openwall.com/lists/oss-security/2022/07/14/1mailing-list, third-party-advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TRZG5CDUQ27OWTPC5MQOR4UASNXHWEZS/vendor-advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/DDI325LOO2XBDDKLINOAQJEG6MHAURZE/vendor-advisory
https://support.apple.com/kb/HT213496third-party-advisory
http://seclists.org/fulldisclosure/2022/Nov/1mailing-list, third-party-advisory
https://lists.debian.org/debian-lts-announce/2022/12/msg00025.htmlmailing-list, third-party-advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/DIKWISWUDFT2FAITYIA6372BVLH3OOOC/vendor-advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YROCMBWYFKRSS64PO6FUNM6L7LKBUKVW/vendor-advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HVOLER2PIGMHPQMDGG4RDE2KZB74QLA2/vendor-advisory

Sources

SourceRecordLicence
CVE ListCVE-2022-29187 changed 2024-08-03CVE Terms of Use
NVDCVE-2022-29187 changed 2026-06-17Public domain