# CVE-2025-4674: Unexpected command execution in untrusted VCS repositories in cmd/go

> The Go command may execute unexpected commands when operating in untrusted VCS repositories with dangerous configuration, allowing code execution.

- **Severity:** High 8.6 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 29 Jul 2025
- **Updated:** 4 Nov 2025
- **Also known as:** ALSA-2025:13935, ALSA-2025:13940, AZL-66098, AZL-66101, BELL-CVE-2025-4674, BIT-golang-2025-4674, CLEANSTART-2026-DA21677, CLEANSTART-2026-YD16450, CLSA-2025-1756931716, DEBIAN-CVE-2025-4674, ECHO-6fb1-590b-9dd9, GHSA-wprm-fgrx-xj42, GO-2025-3828, MGASA-2025-0205, MINI-2cxj-c57q-397w, MINI-2fvm-qmmp-j33m, MINI-2wjx-wh7p-3qvm, MINI-33vx-9rpj-w2g9, MINI-34p5-9r6x-cf85, MINI-3j9p-pphr-6wx7, MINI-3qcr-2h43-9hcr, MINI-3qh2-4hxg-xrmw, MINI-447w-72px-p6x4, MINI-4cr3-mg3q-3f27, MINI-4wpj-459m-3932, MINI-524x-c63r-963q, MINI-554q-3v7g-p326, MINI-5mh4-xrvj-6xgc, MINI-5r5f-6frq-66wx, MINI-5wqq-c366-f2r9, MINI-62hf-m4jq-rgvr, MINI-638m-6wmj-5r55, MINI-66wv-xxg9-x494, MINI-6qm9-pm7w-q29w, MINI-6x7h-wg96-3vmj, MINI-6xp3-m2pm-45g7, MINI-7m88-253j-rqh7, MINI-7mj6-7q5x-wgc4, MINI-8567-xqj9-75v7, MINI-8whv-xj6h-4824, MINI-922p-wpjx-87xp, MINI-93m5-xf6f-pjgp, MINI-9j7x-xxc7-84q5, MINI-c446-p3f7-qxh3, MINI-c5xg-qqqm-3wg9, MINI-c6xf-mr69-5h53, MINI-ch96-342v-8mv7, MINI-cqcc-c2xv-pqxq, MINI-cr5g-9977-8jwf, MINI-cv3m-27r6-9p7w, MINI-cv7c-75r7-m84r, MINI-f2c6-3h5c-f2f4, MINI-f657-r5jm-r3xr, MINI-f67c-x4qv-9c6v, MINI-fjh7-6782-prpw, MINI-fmq5-f632-fc4q, MINI-g3p3-mv49-8qf3, MINI-g5c2-rhjr-j5pc, MINI-g84h-8qc3-68pq, MINI-gpr6-8f34-f834, MINI-gvfx-43g3-r6qq, MINI-gx4f-mwj5-pp28, MINI-gxx6-wqr3-9hv4, MINI-h36c-j8gg-rxq7, MINI-h48x-f5xv-6pr5, MINI-h92p-436m-vc56, MINI-hf5g-j875-352f, MINI-hhwg-xhrq-rj38, MINI-hjc4-hx3c-cwp2, MINI-hr78-35cf-j7q5, MINI-j4h5-vjcp-x42p, MINI-jcg5-vhr7-m3hw, MINI-jjxp-vj3h-j446, MINI-jm69-fxqq-8xw7, MINI-jr6j-qm5w-p827, MINI-jx4m-xrq8-gcp7, MINI-jx89-hfhq-89fx, MINI-mj57-gj77-48m2, MINI-mp74-g5m5-r6fw, MINI-mw76-hrj8-mm9g, MINI-phfx-7vrv-7x9p, MINI-q655-3v84-m3q2, MINI-qjr7-qqhx-fpf4, MINI-qw6m-w5xx-64j9, MINI-r2jh-q7hp-93gp, MINI-r87v-g2h3-pg64, MINI-rhrq-g48f-h735, MINI-rm3p-vr56-qr4v, MINI-rpqw-hrmm-rcjv, MINI-rr9x-p839-hgwr, MINI-rw29-8xg2-3v5f, MINI-v6g8-7x6g-cjg4, MINI-v8xj-w2hg-cqxc, MINI-w67r-8pxq-wjv4, MINI-w6xc-7vh4-m2pr, MINI-w93x-254j-9gvv, MINI-wc86-fxrv-9hc8, MINI-wqq4-ppfr-c68c, MINI-ww6w-8rvh-pgv2, MINI-x22g-f835-h2fh, MINI-x64v-rrxq-pfj9, MINI-xvx2-7whc-vg2j, MINI-xw3w-9crp-gr2j, RHSA-2025:13936, RHSA-2025:13939, RHSA-2025:13940, RHSA-2025:14093, RLSA-2025:13935, RLSA-2025:13940, RLSA-2025:13941, ROOT-OS-DEBIAN-13-CVE-2025-4674, SUSE-SU-2025:02295-1, SUSE-SU-2025:02296-1, UBUNTU-CVE-2025-4674, openSUSE-SU-2025:15328-1, openSUSE-SU-2025:15329-1, openSUSE-SU-2025:15330-1

## What is CVE-2025-4674?

CVE-2025-4674 is a high-severity command injection vulnerability in Golang Go, published on 29 Jul 2025. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

The go command may execute unexpected commands when operating in untrusted VCS repositories. This occurs when possibly dangerous VCS configuration is present in repositories. This can happen when a repository was fetched via one VCS (e.g. Git), but contains metadata for another VCS (e.g. Mercurial). Modules which are retrieved using the go command line, i.e. via "go get", are not affected.

Weakness: CWE-73 (External Control of File Name or Path)

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

2 open source packages ship an affected version, including golang and toolchain. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `golang` | Bitnami | All versions | 1.23.11, 1.24.5 |
| `toolchain` | Go | All versions | 1.23.11, 1.24.5 |
| `delve` | AlmaLinux:8 | All versions | 1.24.1-1.module_el8.10.0+3977+66935a26 |
| `go-toolset` | AlmaLinux:8 | All versions | 1.24.6-1.module_el8.10.0+4033+4bf8b620 |
| `golang` | AlmaLinux:8 | All versions | 1.24.6-1.module_el8.10.0+4033+4bf8b620 |
| `golang-bin` | AlmaLinux:8 | All versions | 1.24.6-1.module_el8.10.0+4033+4bf8b620 |
| `golang-docs` | AlmaLinux:8 | All versions | 1.24.6-1.module_el8.10.0+4033+4bf8b620 |
| `golang-misc` | AlmaLinux:8 | All versions | 1.24.6-1.module_el8.10.0+4033+4bf8b620 |
| `golang-src` | AlmaLinux:8 | All versions | 1.24.6-1.module_el8.10.0+4033+4bf8b620 |
| `golang-tests` | AlmaLinux:8 | All versions | 1.24.6-1.module_el8.10.0+4033+4bf8b620 |
| `go-toolset` | AlmaLinux:9 | All versions | 1.24.6-1.el9_6 |
| `golang` | AlmaLinux:9 | All versions | 1.24.6-1.el9_6 |
| `golang-bin` | AlmaLinux:9 | All versions | 1.24.6-1.el9_6 |
| `golang-docs` | AlmaLinux:9 | All versions | 1.24.6-1.el9_6 |
| `golang-misc` | AlmaLinux:9 | All versions | 1.24.6-1.el9_6 |
| `golang-race` | AlmaLinux:9 | All versions | 1.24.6-1.el9_6 |
| `golang-src` | AlmaLinux:9 | All versions | 1.24.6-1.el9_6 |
| `golang-tests` | AlmaLinux:9 | All versions | 1.24.6-1.el9_6 |
| `delve` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.24.1-1.module+el8.10.0+22945+b2c96a17 |
| `delve-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.24.1-1.module+el8.10.0+22945+b2c96a17 |
| `delve-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.24.1-1.module+el8.10.0+22945+b2c96a17 |
| `go-toolset` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.24.6-1.module+el8.10.0+23407+428597c7 |
| `golang` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.24.6-1.module+el8.10.0+23407+428597c7 |
| `golang-bin` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.24.6-1.module+el8.10.0+23407+428597c7 |
| `golang-docs` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.24.6-1.module+el8.10.0+23407+428597c7 |
| `golang-misc` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.24.6-1.module+el8.10.0+23407+428597c7 |
| `golang-src` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.24.6-1.module+el8.10.0+23407+428597c7 |
| `golang-tests` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.24.6-1.module+el8.10.0+23407+428597c7 |
| `delve` | Red Hat:rhel_e4s:8.8::appstream | All versions | 0:1.9.1-1.module+el8.8.0+16778+5fbb74f5 |
| `delve-debuginfo` | Red Hat:rhel_e4s:8.8::appstream | All versions | 0:1.9.1-1.module+el8.8.0+16778+5fbb74f5 |
| `delve-debugsource` | Red Hat:rhel_e4s:8.8::appstream | All versions | 0:1.9.1-1.module+el8.8.0+16778+5fbb74f5 |
| `go-toolset` | Red Hat:rhel_e4s:8.8::appstream | All versions | 0:1.19.13-3.module+el8.8.0+22903+37387f31 |
| `golang` | Red Hat:rhel_e4s:8.8::appstream | All versions | 0:1.19.13-16.module+el8.8.0+23410+958e78d9 |
| `golang-bin` | Red Hat:rhel_e4s:8.8::appstream | All versions | 0:1.19.13-16.module+el8.8.0+23410+958e78d9 |
| `golang-docs` | Red Hat:rhel_e4s:8.8::appstream | All versions | 0:1.19.13-16.module+el8.8.0+23410+958e78d9 |
| `golang-misc` | Red Hat:rhel_e4s:8.8::appstream | All versions | 0:1.19.13-16.module+el8.8.0+23410+958e78d9 |
| `golang-race` | Red Hat:rhel_e4s:8.8::appstream | All versions | 0:1.19.13-16.module+el8.8.0+23410+958e78d9 |
| `golang-src` | Red Hat:rhel_e4s:8.8::appstream | All versions | 0:1.19.13-16.module+el8.8.0+23410+958e78d9 |
| `golang-tests` | Red Hat:rhel_e4s:8.8::appstream | All versions | 0:1.19.13-16.module+el8.8.0+23410+958e78d9 |
| `golang` | Red Hat:rhel_e4s:9.2::appstream | All versions | 0:1.19.13-18.el9_2 |

Products: Golang Go.

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

Upgrade golang to a fixed version for your release line: 1.23.11 or 1.24.5.

## Is CVE-2025-4674 being exploited?

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

## Other vulnerabilities in Golang Go

- [CVE-2020-0601](https://insights.sbomify.com/CVE-2020-0601/): Microsoft Windows CryptoAPI Spoofing (high 8.1, exploited in the wild)
- [CVE-2026-27143](https://insights.sbomify.com/CVE-2026-27143/): Missing bound checks can lead to memory corruption in safe Go in cmd/compile (critical 9.8)
- [CVE-2024-24790](https://insights.sbomify.com/CVE-2024-24790/): Unexpected behavior from Is methods for IPv4-mapped IPv6 addresses in net/netip (critical 9.8)
- [CVE-2023-39320](https://insights.sbomify.com/CVE-2023-39320/): Arbitrary code execution via go.mod toolchain directive in cmd/go (critical 9.8)
- [CVE-2023-24540](https://insights.sbomify.com/CVE-2023-24540/): Improper handling of JavaScript whitespace in html/template (critical 9.8)

## Fix prompt for AI coding agents

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

What it is: CVE-2025-4674 is a high-severity command injection vulnerability in Golang Go, published on 29 Jul 2025. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2025-4674 in the wild and no public exploit code.

Affected packages and fixed versions:
- golang (Bitnami): affected all versions; fixed in 1.23.11, 1.24.5
- toolchain (Go): affected all versions; fixed in 1.23.11, 1.24.5

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

## Sources

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

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