# CVE-2026-45571: go-git: Crafted repositories may modify main and submodule .git directories

> Crafted repositories can modify .git directories outside the checkout target, potentially leading to code execution or data modification.

- **Severity:** Medium 5.4 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 27 May 2026
- **Updated:** 27 May 2026
- **Also known as:** AZL-88415, AZL-88797, BELL-CVE-2026-45571, CLEANSTART-2026-KV85697, CLEANSTART-2026-NG68167, CLEANSTART-2026-UL53723, CLEANSTART-2026-XT72047, DEBIAN-CVE-2026-45571, GHSA-crhj-59gh-8x96, GO-2026-5336, MINI-22xr-j55w-ggr3, MINI-23pf-mjvh-wjc3, MINI-2466-c92v-ff37, MINI-27g8-g9w6-pg3j, MINI-288h-wrrc-pr2x, MINI-2f48-2rj4-8qrc, MINI-2g65-whfp-7389, MINI-2h74-56hx-j4jg, MINI-2mx4-c4m4-875h, MINI-2qrx-xxgq-5hmj, MINI-2r8w-mg76-pmg5, MINI-2rv3-8786-4frv, MINI-2vr8-f97h-vr49, MINI-353q-9qwp-rxh8, MINI-384r-7p4q-mjqm, MINI-38v3-9qpm-g39r, MINI-3cc8-3gq9-p3v6, MINI-3j35-mgv2-rpxv, MINI-3jg2-xp4m-j83h, MINI-3jr7-r3v7-rjh9, MINI-3m5p-pwpc-5vwc, MINI-3mhw-qv5c-646j, MINI-3mr6-4x2q-397j, MINI-3rfv-6rhg-fq9p, MINI-4287-wmx2-qq2p, MINI-43jx-p52j-96w5, MINI-43vx-rvwg-r8fr, MINI-4c9p-3rx7-rwq9, MINI-4h55-mhhg-vfjw, MINI-4xmr-c6qf-hvc6, MINI-596m-24p3-c6pq, MINI-5h37-39fp-34vf, MINI-5wfw-fx4r-9vrc, MINI-62hw-pgmq-j3x9, MINI-62mv-gmg6-rjj4, MINI-6666-jwx2-g5pr, MINI-6jm4-69hg-c54x, MINI-6jwh-xmw7-8h4q, MINI-6qgr-vprm-qr86, MINI-6r7h-j7ww-h45p, MINI-6v7f-r2jg-3q5q, MINI-6wmr-j2w3-7jxr, MINI-6x8h-mg49-q4rj, MINI-72gj-v9hr-w5r8, MINI-72ww-2vcj-gh7h, MINI-74cq-cwfj-h6v8, MINI-75jm-jj7r-33qj, MINI-788r-9q4v-vm7r, MINI-7cjc-9fcf-9xf2, MINI-7g34-wv75-w2mr, MINI-7jc5-rvrm-9c99, MINI-7p4v-3627-85gw, MINI-7x5p-2x72-wf6g, MINI-7x79-v7mc-4hq4, MINI-7x8r-x2xp-3vvf, MINI-8483-5524-mcrj, MINI-8878-wjxx-2gh9, MINI-88q7-6qg9-cvpr, MINI-8f45-97m8-8573, MINI-8g7g-v47v-6x5m, MINI-8gg7-7mj7-gp85, MINI-8m49-682v-v9qh, MINI-8p5q-4f43-2499, MINI-8p9v-xjrx-p84w, MINI-8vj3-522j-2f4w, MINI-923g-f98x-vf24, MINI-9347-v744-67h7, MINI-94g4-p23x-4gqw, MINI-97wh-58gq-9qpw, MINI-98x6-3mgr-v64q, MINI-9j48-2hh6-hw27, MINI-9j4v-rvqq-98x7, MINI-9j8h-wqqp-p7p9, MINI-9rp3-hj6v-j4xf, MINI-9vf4-rh6x-c96w, MINI-9vww-8f5w-2ph6, MINI-c335-3f9r-9fgv, MINI-c4gr-r2v3-pqm3, MINI-c59h-6976-m6fv, MINI-c6v2-xq4h-qqjf, MINI-c895-cwjh-86vf, MINI-ch6f-qgvv-9pr8, MINI-cjmw-7m27-r4hm, MINI-cp77-f95v-2gvp, MINI-cpmf-gh3f-x9wr, MINI-cwmr-rvw9-7mqq, MINI-cx52-8rv6-wc49, MINI-cx6f-hr3g-x9wg, MINI-f6wv-395q-vpvw, MINI-ff47-xpj2-wqv8, MINI-ffcv-vp5q-84gj, MINI-ffrr-q7g2-6r8v, MINI-fph9-r82g-rj9w, MINI-fx7h-6pr9-2jx6, MINI-g267-m938-r6jq, MINI-g63w-mw49-mfrq, MINI-g89h-jx88-6fwx, MINI-g942-5mx9-h4qm, MINI-g964-89mf-qr75, MINI-g9cj-7x3c-gpjx, MINI-g9wg-fmr3-3cxw, MINI-gh28-9wjq-2f3v, MINI-gv9h-5926-8xvj, MINI-h2h3-743q-vxgv, MINI-h376-c7fg-2cq5, MINI-h3pm-c9m9-m3qv, MINI-h56g-xrcm-jvrh, MINI-h8gq-mwvp-qrhq, MINI-hgf8-g53g-rv24, MINI-hmwj-4pxr-46h6, MINI-j8qj-2pj8-c9v7, MINI-jfg7-7r9q-ffv4, MINI-jm6h-69p3-3fgx, MINI-jrwr-27gf-vgqw, MINI-jw4p-h3w4-6w6v, MINI-m26q-8jrp-mqr9, MINI-m648-pxh9-9j96, MINI-mc73-9h6w-vf8j, MINI-mfqc-pjmh-4vpx, MINI-mfww-cqqg-xw8c, MINI-mqc7-5m4x-33pg, MINI-mwh2-925x-h4hr, MINI-p25r-pq54-2q4w, MINI-p2p2-fqfw-m35p, MINI-p3wx-gp28-rmh7, MINI-p5v7-ccqf-7p4q, MINI-p624-mqcm-xc6p, MINI-p6q4-jw6p-xwpv, MINI-p967-84gm-wf28, MINI-p9wc-3cpp-ww3g, MINI-phgf-f988-9gq6, MINI-pv3g-hpww-gr2c, MINI-pwhj-ccgx-vp8g, MINI-q2wh-2vg2-qh94, MINI-q49p-fpxh-j4fq, MINI-q5pm-8jj3-r4h2, MINI-q5r7-43h7-3j2c, MINI-q8c9-54w7-54gv, MINI-r775-pp38-9c5h, MINI-r79w-xcx2-v89j, MINI-r852-34cj-54cf, MINI-r8rc-7g49-j4p9, MINI-rc3p-rc6x-mf9m, MINI-rchm-w77j-293h, MINI-rcp9-fr94-3gjq, MINI-rgg5-6hm3-qf7p, MINI-rj9w-2vf5-8x3m, MINI-rjrj-8gxj-2h4w, MINI-rqfj-4v54-x8jq, MINI-v2q3-cpfr-mvfg, MINI-v5fv-qf7r-vwp2, MINI-v6p5-3j9v-c27j, MINI-v8jm-3294-mwhc, MINI-v9vm-29cx-433q, MINI-vmr8-h46v-fxhr, MINI-vq6x-5p35-xfpw, MINI-vqx5-fp7r-jxxc, MINI-vx6f-6724-fr8q, MINI-w563-x3wg-94hq, MINI-w8xp-6ppx-2j4g, MINI-wf68-h4r8-cr5w, MINI-wgr6-wx5f-jvhf, MINI-wj74-3fm9-xhxq, MINI-wjj3-5f8x-4fxm, MINI-wqvc-c76r-7gf9, MINI-wr34-4568-6x8p, MINI-wv48-gfxv-4crj, MINI-wwr3-vmfw-832j, MINI-x2m3-x94g-9vh8, MINI-x6q3-pmpw-wqrf, MINI-x87q-jxf4-966f, MINI-xfmr-jr6x-h33m, MINI-xfwh-2h7c-p8xw, MINI-xg44-cgcw-3mp2, MINI-xghw-r3c2-8m92, MINI-xhcg-4jpj-wmfv, MINI-xmm6-m774-6wf5, MINI-xvc4-fj65-8w5h, MINI-xvvc-822p-fvp3, UBUNTU-CVE-2026-45571

## What is CVE-2026-45571?

CVE-2026-45571 is a medium-severity path traversal vulnerability in go-git, published on 27 May 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

go-git is an extensible git implementation library written in pure Go. Prior to 5.19.1 and 6.0.0-alpha.4, a path validation issue in go-git could allow crafted repository data to affect files outside the intended checkout target, including the repository's .git directory. These validations were introduced in upstream Git years ago, so the vulnerability arose from go-git drifting from those checks. This vulnerability is fixed in 5.19.1 and 6.0.0-alpha.4.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2026-45571?

7 open source packages ship an affected version, including github.com/go-git/go-git/v5, github.com/go-git/go-git and github.com/go-git/go-git/v6. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/go-git/go-git/v5` | Go | All versions | 5.19.1 |
| `github.com/go-git/go-git/v5` | Go | All versions | 5.19.1 |
| `github.com/go-git/go-git/v5` | Go | All versions | 5.19.1 |
| `github.com/go-git/go-git` | Go | All versions to 44.7.0 | None |
| `github.com/go-git/go-git` | Go | All versions to 44.7.0 | None |
| `github.com/go-git/go-git/v6` | Go | All versions | 6.0.0-alpha.4 |
| `github.com/go-git/go-git/v6` | Go | All versions | 6.0.0-alpha.4 |

Products: Go-Git Project Go-Git.

## How do I fix CVE-2026-45571?

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

## Is CVE-2026-45571 being exploited?

There is no known exploitation of CVE-2026-45571 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-21613](https://insights.sbomify.com/CVE-2025-21613/): go-git has an Argument Injection via the URL field (critical 9.2)
- [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)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-45571 and fix it if it is affected.

What it is: CVE-2026-45571 is a medium-severity path traversal vulnerability in go-git, published on 27 May 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-45571 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.19.1
- github.com/go-git/go-git/v5 (Go): affected all versions; fixed in 5.19.1
- github.com/go-git/go-git/v5 (Go): affected all versions; fixed in 5.19.1
- github.com/go-git/go-git (Go): affected all versions up to 44.7.0; no fix listed
- github.com/go-git/go-git (Go): affected all versions up to 44.7.0; no fix listed
- github.com/go-git/go-git/v6 (Go): affected all versions; fixed in 6.0.0-alpha.4
- github.com/go-git/go-git/v6 (Go): affected all versions; fixed in 6.0.0-alpha.4

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-2026-45571/ (Markdown: https://insights.sbomify.com/CVE-2026-45571/index.md)
```

## Sources

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

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