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.
- 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
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
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 | Affected | Fixed in |
|---|---|---|
golang Bitnami | All versions | 1.23.11, 1.24.5 |
toolchain Go | All versions | 1.23.11, 1.24.5 |
Linux distribution packages (38)
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 include 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.
Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.
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 Microsoft Windows CryptoAPI Spoofing
- CVE-2026-27143 Missing bound checks can lead to memory corruption in safe Go in cmd/compile
- CVE-2024-24790 Unexpected behavior from Is methods for IPv4-mapped IPv6 addresses in net/netip
- CVE-2023-39320 Arbitrary code execution via go.mod toolchain directive in cmd/go
- CVE-2023-24540 Improper handling of JavaScript whitespace in html/template
Sources
Also known as ALSA-2025:13935, ALSA-2025:13940, AZL-66098, AZL-66101, BELL-CVE-2025-4674, BIT-golang-2025-4674 and 111 more.