Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

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

0
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: 11/04/2025, 21:55:05 UTC

Technical Analysis

CVE-2025-4674 is a vulnerability classified under CWE-73 (External Control of File Name or Path) affecting the Go programming language toolchain, specifically the cmd/go command. The issue arises when cmd/go operates on repositories fetched from one version control system (VCS) but containing metadata from another VCS, for example, a Git-fetched repository containing Mercurial metadata. This discrepancy can cause cmd/go to execute unexpected commands or access unintended file paths, potentially leading to arbitrary code execution or manipulation of files. The vulnerability affects all Go versions up to 1.24.0-0 and is triggered when working with untrusted VCS repositories, but notably does not affect modules retrieved via the 'go get' command. The CVSS v3.1 score is 8.6 (high), with attack vector local (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). This means an attacker with local access and the ability to trick a user into interacting with a malicious repository can exploit this vulnerability to gain significant control over the system. No public exploits are known yet, but the vulnerability poses a serious risk to development environments and build pipelines that handle untrusted or mixed VCS repositories. The vulnerability was reserved in May 2025 and published in July 2025, with no patches currently linked, indicating that mitigation relies on cautious repository handling and upcoming updates from the Go project.

Potential Impact

For European organizations, the impact of CVE-2025-4674 can be substantial, especially for those heavily reliant on Go for software development, continuous integration/continuous deployment (CI/CD) pipelines, and automated build systems. Exploitation could lead to unauthorized code execution, data leakage, or destruction of build artifacts, undermining software integrity and availability. This could disrupt development workflows, cause supply chain compromises, or introduce backdoors into software products. Organizations using untrusted or third-party VCS repositories are particularly vulnerable, as malicious actors could craft repositories with mixed VCS metadata to trigger the vulnerability. The confidentiality of proprietary source code and intellectual property could be compromised, and the integrity of software releases jeopardized. Additionally, availability of development environments and build servers could be impacted, causing operational delays. Given the high CVSS score and scope change, the vulnerability could also facilitate lateral movement within networks if exploited in shared development environments. The lack of known exploits in the wild currently provides a window for proactive mitigation, but the risk remains high due to the ease of exploitation and significant potential impact.

Mitigation Recommendations

1. Immediately restrict usage of untrusted or unknown VCS repositories, especially those fetched from one VCS but containing metadata from another. 2. Implement strict validation and sanitization of VCS metadata before allowing cmd/go operations on repositories. 3. Use isolated and sandboxed environments for building and testing code from untrusted sources to contain potential exploitation. 4. Monitor and audit repository metadata for inconsistencies or suspicious entries indicative of mixed VCS data. 5. Educate developers and DevOps teams about the risks of using mixed or untrusted repositories and the importance of verifying repository provenance. 6. Apply principle of least privilege to build and development environments to limit the impact of potential exploitation. 7. Track Go toolchain updates closely and apply patches as soon as they become available. 8. Consider using alternative methods or tools for fetching and managing dependencies that do not rely on cmd/go when dealing with untrusted repositories. 9. Integrate repository scanning tools into CI/CD pipelines to detect and block suspicious VCS metadata before build steps. 10. Maintain comprehensive backups of build environments and source code to enable rapid recovery in case of compromise.

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: 11/4/2025, 9:55:05 PM

Last updated: 12/12/2025, 3:21:32 AM

Views: 99

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

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