CVE-2025-21613
JSON

9.2critical

go-git has an Argument Injection via the URL field

Severity
9.2critical CVSS:4.0 by GitHub_M
Exploit likelihood
1.28% (higher than 70% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-v725-9546-7q7mGO-2025-3368

Description

go-git is a highly extensible git implementation library written in pure Go. An argument injection vulnerability was discovered in go-git versions prior to v5.13. Successful exploitation of this vulnerability could allow an attacker to set arbitrary values to git-upload-pack flags. This only happens when the file transport protocol is being used, as that is the only protocol that shells out to git binaries. This vulnerability is fixed in 5.13.0.

Affected

Product or packageVersionsReported by
go-git go-git>= 4.0.0, < 5.13.0CVE List
gopkg.in/src-d/go-git.v4 (Go)from 4.0.0 up to 4.13.1, from 4.0.0GitHub Advisory Database, Go Vulnerability Database
github.com/go-git/go-git/v5 (Go)before 5.13.0GitHub Advisory Database, Go Vulnerability Database
github.com/go-git/go-git/v4 (Go)from 4.0.0Go Vulnerability Database
go-git_project go-gitbefore 5.13.0NVD

All scores

GitHub_M9.2critical CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/U:Clear
CISA-ADP9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GitHub9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GitHubcritical CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:Clear

Classification

CWE-88

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

go-git is a highly extensible git implementation library written in pure Go. An argument injection vulnerability was discovered in go-git versions prior to v5.13. Successful exploitation of this vulnerability could allow an attacker to set arbitrary values to git-upload-pack flags. This only happens when the file transport protocol is being used, as that is the only protocol that shells out to git binaries. This vulnerability is fixed in 5.13.0.

GitHub Advisory Database
Impact

An argument injection vulnerability was discovered in go-git versions prior to v5.13.

Successful exploitation of this vulnerability could allow an attacker to set arbitrary values to git-upload-pack flags. This only happens when the file transport protocol is being used, as that is the only protocol that shells out to git binaries.

Affected versions

Users running versions of go-git from v4 and above are recommended to upgrade to v5.13 in order to mitigate this vulnerability.

Workarounds

In cases where a bump to the latest version of go-git is not possible, we recommend users to enforce restrict validation rules for values passed in the URL field.

Credit

Thanks to @vin01 for responsibly disclosing this vulnerability to us.

Go Vulnerability Database

Argument Injection via the URL field in github.com/go-git/go-git

NVD (es)

Go-git es una librería de implementación de Git altamente extensible escrita en Go puro. Se descubrió una vulnerabilidad de inyección de argumentos en versiones de Go-git anteriores a la v5.13. La explotación exitosa de esta vulnerabilidad podría permitir a un atacante establecer valores arbitrarios para los indicadores git-upload-pack. Esto solo sucede cuando se utiliza el protocolo de transporte de archivos, ya que es el único protocolo que realiza transferencias a binarios de Git. Esta vulnerabilidad se corrigió en la versión 5.13.0.

References

Related

Sources

SourceRecordLicence
CVE ListCVE-2025-21613 changed 2025-01-06CVE Terms of Use
GitHub Advisory DatabaseGHSA-v725-9546-7q7m changed 2026-09-10CC-BY-4.0
Go Vulnerability DatabaseGO-2025-3368 changed 2026-11-23CC-BY-4.0
NVDCVE-2025-21613 changed 2026-06-17Public domain