Skip to main content

CVE-2025-4674: CWE-73: External Control of File Name or Path in Go toolchain cmd/go

High
VulnerabilityCVE-2025-4674cvecve-2025-4674cwe-73
Published: Tue Jul 29 2025 (07/29/2025, 21:19:08 UTC)
Source: CVE Database V5
Vendor/Project: Go toolchain
Product: cmd/go

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.

AI-Powered Analysis

AILast updated: 08/07/2025, 00:38:15 UTC

Technical Analysis

CVE-2025-4674 is a high-severity vulnerability affecting the Go programming language toolchain, specifically the 'cmd/go' command. The vulnerability arises from the external control of file names or paths (CWE-73) when the 'go' command operates within untrusted version control system (VCS) repositories. The issue occurs if a repository fetched via one VCS (for example, Git) contains metadata or configuration files from another VCS (such as Mercurial). This unexpected presence of cross-VCS metadata can cause the 'go' command to execute unintended commands or scripts embedded in these files, potentially leading to arbitrary code execution. Importantly, modules retrieved using the 'go get' command are not affected, indicating the vulnerability is tied to direct interaction with repositories containing mixed or unexpected VCS metadata. The vulnerability affects all versions of the Go toolchain up to and including version 1.24.0-0. The CVSS v3.1 score is 8.6, reflecting a high severity with a vector indicating local attack vector (AV:L), low attack complexity (AC:L), no privileges required (PR:N), user interaction required (UI:R), scope changed (S:C), and high impact on confidentiality, integrity, and availability (C:H/I:H/A:H). No known exploits are currently reported in the wild, and no patches have been linked yet, suggesting that remediation may still be pending or in progress. This vulnerability is particularly dangerous because it can lead to full compromise of the development environment or build systems if an attacker can trick a developer or automated system into operating on a maliciously crafted repository containing mixed VCS metadata. The exploitation requires user interaction, such as running the 'go' command in the context of the malicious repository, but does not require prior authentication or elevated privileges, increasing the risk in environments where developers routinely clone and build code from various sources.

Potential Impact

For European organizations, the impact of CVE-2025-4674 can be significant, especially those relying heavily on Go for software development, CI/CD pipelines, or internal tooling. Successful exploitation could lead to arbitrary code execution on developer machines or build servers, resulting in potential data breaches, insertion of malicious code into software supply chains, and disruption of software delivery processes. Confidentiality could be compromised if sensitive source code or credentials are accessed or exfiltrated. Integrity is at risk as attackers could inject backdoors or alter codebases undetected. Availability could also be affected if build environments are destabilized or taken offline due to malicious payloads. Given the widespread use of Go in cloud-native applications, microservices, and infrastructure tooling, the vulnerability poses a threat to the security posture of European enterprises, particularly in sectors like finance, telecommunications, and critical infrastructure where software integrity is paramount. The requirement for user interaction means that social engineering or supply chain attacks could facilitate exploitation, emphasizing the need for secure development practices and repository vetting. The absence of known exploits in the wild provides a window for proactive mitigation, but the high CVSS score underscores the urgency of addressing this vulnerability.

Mitigation Recommendations

To mitigate CVE-2025-4674, European organizations should implement several specific measures beyond generic patching advice: 1) Avoid running 'go' commands directly on repositories obtained from untrusted or unknown sources, especially those that may contain mixed VCS metadata. 2) Implement strict repository validation and sanitization processes to detect and remove unexpected VCS metadata files before performing build or dependency resolution operations. 3) Use containerized or isolated build environments to limit the impact of potential code execution during development or CI/CD processes. 4) Monitor and restrict developer and build system permissions to minimize the scope of potential exploitation. 5) Educate developers about the risks of executing commands in untrusted repositories and enforce policies requiring verification of repository provenance. 6) Track updates from the Go project for patches addressing this vulnerability and apply them promptly once available. 7) Employ runtime security tools that can detect anomalous command executions or file system modifications during builds. 8) Integrate static and dynamic analysis tools in the development pipeline to detect suspicious repository metadata or build behaviors. These targeted mitigations will reduce the attack surface and limit the potential damage from exploitation of this vulnerability.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Go
Date Reserved
2025-05-13T23:31:07.620Z
Cvss Version
null
State
PUBLISHED

Threat ID: 68893dfdad5a09ad00914ec8

Added to database: 7/29/2025, 9:32:45 PM

Last enriched: 8/7/2025, 12:38:15 AM

Last updated: 9/10/2025, 5:48:44 PM

Views: 55

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats