# CVE-2025-21613: go-git has an Argument Injection via the URL field

> Attackers can inject arguments into git commands via the URL field when using the file transport protocol, potentially leading to code execution.

- **Severity:** Critical 9.2 (`CVSS: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`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 6 Jan 2025
- **Updated:** 6 Jan 2025
- **Also known as:** AZL-55060, AZL-55067, AZL-55088, AZL-55094, CLEANSTART-2026-YJ06011, DEBIAN-CVE-2025-21613, GHSA-v725-9546-7q7m, GO-2025-3368, MINI-39hc-v532-7664, MINI-7rc3-2v58-ww4c, MINI-8w3m-f3jr-mxxp, MINI-gc49-jjpm-94vg, SUSE-SU-2025:0191-1, SUSE-SU-2025:0277-1, UBUNTU-CVE-2025-21613, openSUSE-SU-2025:14654-1, openSUSE-SU-2025:14658-1, openSUSE-SU-2025:14752-1, openSUSE-SU-2025:15438-1

## What is CVE-2025-21613?

CVE-2025-21613 is a critical command injection vulnerability in go-git, published on 6 Jan 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-88 (Improper Neutralization of Argument Delimiters in a Command)

## Which versions are affected by CVE-2025-21613?

7 open source packages ship an affected version, including github.com/go-git/go-git/v5, github.com/go-git/go-git/v4 and gopkg.in/src-d/go-git.v4. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/go-git/go-git/v5` | Go | All versions | 5.13.0 |
| `github.com/go-git/go-git/v5` | Go | All versions | 5.13.0 |
| `github.com/go-git/go-git/v5` | Go | All versions | 5.13.0 |
| `github.com/go-git/go-git/v4` | Go | From 4.0.0 | None |
| `gopkg.in/src-d/go-git.v4` | Go | From 4.0.0 | None |
| `gopkg.in/src-d/go-git.v4` | Go | From 4.0.0 to 4.13.1 | None |
| `gopkg.in/src-d/go-git.v4` | Go | From 4.0.0 to 4.13.1 | None |
| `amazon-ssm-agent` | SUSE:Linux Enterprise Module for Public Cloud 12 | All versions | 3.3.1611.0-4.36.1 |
| `amazon-ssm-agent` | SUSE:Linux Enterprise Module for Public Cloud 15 SP3 | All versions | 3.3.1611.0-150000.5.20.1 |
| `amazon-ssm-agent` | SUSE:Linux Enterprise Module for Public Cloud 15 SP4 | All versions | 3.3.1611.0-150000.5.20.1 |
| `amazon-ssm-agent` | SUSE:Linux Enterprise Module for Public Cloud 15 SP5 | All versions | 3.3.1611.0-150000.5.20.1 |
| `amazon-ssm-agent` | SUSE:Linux Enterprise Module for Public Cloud 15 SP6 | All versions | 3.3.1611.0-150000.5.20.1 |
| `amazon-ssm-agent` | openSUSE:Leap 15.6 | All versions | 3.3.1611.0-150000.5.20.1 |
| `amazon-ssm-agent` | openSUSE:Tumbleweed | All versions | 3.3.1611.0-1.1 |
| `brise` | openSUSE:Tumbleweed | All versions | 20230603+git.5fdd2d6-5.1 |
| `grafana` | openSUSE:Tumbleweed | All versions | 11.3.0-5.1 |
| `rz-pm` | openSUSE:Tumbleweed | All versions | 0.3.3+git~14~gcee0d0d-1.1 |

Products: Go-Git Project Go-Git.

## How do I fix CVE-2025-21613?

Upgrade github.com/go-git/go-git/v5 to 5.13.0 or later.

## Is CVE-2025-21613 being exploited?

There is no known exploitation of CVE-2025-21613 in the wild and no public exploit code.

## Other vulnerabilities in go-git

- [CVE-2023-49569](https://insights.sbomify.com/CVE-2023-49569/): Maliciously crafted Git server replies can lead to path traversal and RCE on go-git clients (critical 9.8)
- [CVE-2025-21614](https://insights.sbomify.com/CVE-2025-21614/): go-git clients vulnerable to DoS via maliciously crafted Git server replies (high 7.5)
- [CVE-2023-49568](https://insights.sbomify.com/CVE-2023-49568/): Maliciously crafted Git server replies can cause DoS on go-git clients (high 7.5)
- [CVE-2026-45022](https://insights.sbomify.com/CVE-2026-45022/): go-git: Improper parsing of specially crafted objects may lead to inconsistent interpretation compared to upstream Git (high 7.0)
- [CVE-2026-45571](https://insights.sbomify.com/CVE-2026-45571/): go-git: Crafted repositories may modify main and submodule .git directories (medium 5.4)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-21613 and fix it if it is affected.

What it is: CVE-2025-21613 is a critical command injection vulnerability in go-git, published on 6 Jan 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-21613 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/go-git/go-git/v5 (Go): affected all versions; fixed in 5.13.0
- github.com/go-git/go-git/v5 (Go): affected all versions; fixed in 5.13.0
- github.com/go-git/go-git/v5 (Go): affected all versions; fixed in 5.13.0
- github.com/go-git/go-git/v4 (Go): affected from 4.0.0; no fix listed
- gopkg.in/src-d/go-git.v4 (Go): affected from 4.0.0; no fix listed
- gopkg.in/src-d/go-git.v4 (Go): affected from 4.0.0 up to 4.13.1; no fix listed
- gopkg.in/src-d/go-git.v4 (Go): affected from 4.0.0 up to 4.13.1; no fix listed

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-21613/ (Markdown: https://insights.sbomify.com/CVE-2025-21613/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-21613
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-21613
- OSV: https://osv.dev/vulnerability/CVE-2025-21613

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-21613/
Summaries are generated and may contain mistakes; the official description above is the record.
