Vulnerability Notice: CVE-2025-21613

Vendor:
Debian

Affected Product:
Debian 13 (Trixie), Debian 12 (Bookworm)

CVSS SCORE:
9.2 of 10 (Critical)

Risk Index:
8.28 of 10 (High)

Description

A critical vulnerability has been identified in the argument handling component of the go-git library. This vulnerability allows attackers to inject arbitrary values into git-upload-pack flags when using the file transport protocol, leading to potential code execution risks.

 

Affected Product(s)

  • go-git versions before v5.13, specifically versions ranging from 0 to 5.12.0
  • Debian 12 (bookworm) with package golang-github-go-git-go-git up to version 5.4.2-3
  • Debian 13 (trixie) with package golang-github-go-git-go-git up to version 5.12.0-1

 

Technical Details

The identified vulnerability in go-git versions prior to v5.13 (CVE-2025-21613) stems from improper argument handling within the URL field, specifically when using the file transport protocol. The go-git library, written in pure Go, serves as an extensible implementation of Git functionalities. When the file transport protocol is used, git binaries are shelled out, which presents an opportunity for attackers to manipulate the git-upload-pack flags. The core issue lies in the way arguments were parsed and handled by the go-git library, particularly through the URL field.

This improper handling allows malicious actors to inject arguments leading to unintended or malicious behavior. For instance, an attacker could set arbitrary values for git-upload-pack flags, which might grant them unauthorized control over the execution of the git commands. The go-git library’s versions from 0 up to 5.12.0 are affected. Different ecosystems and packaging of the library are also impacted, including the gopkg.in/src-d/go-git.v4 with versions from 4.0.0 to 4.13.1. Notably, this issue has led to advisories and security updates across various platforms, emphasizing its severity.

To mitigate this vulnerability, the go-git developers have released a patched version in v5.13.0. This fix involved ensuring the proper sanitization and validation of the inputs within the URL field, thus preventing any argument injection attempts. Security advisories from various vendors, including Red Hat, Debian, and Oracle, have been published, all referencing the need to update to the latest secure version. For developers and administrators using the go-git library, it is crucial to review their deployment and update the library to v5.13.0 or later.

Given the critical rating of this vulnerability, with a CVSS score of 9.8, itโ€™s important to follow the mitigation strategies promptly. This includes applying the necessary patches and employing any provided workarounds to secure systems that use go-git. Failure to do so could result in a significant security breach, potentially leading to arbitrary code execution and further exploitation by threat actors.

For detailed guidance on patching, users can refer to the official go-git repository and security advisories, including:

  • https://github.com/go-git/go-git
  • https://github.com/go-git/go-git/security/advisories/GHSA-v725-9546-7q7m
  • https://access.redhat.com/security/cve/CVE-2025-21613

In summation, this vulnerability highlights the importance of rigorous input handling and sanitization routines within software libraries, especially those interfacing with external command execution components.

Weakness

The weakness associated with this vulnerability is classified under CWE-88: Improper Neutralization of Argument Delimiters in a Command (‘Argument Injection’). This type of flaw occurs when the system fails to properly sanitize or escape special characters in arguments passed to commands, leading to injection attacks.

 

Impact Assessment

If exploited, this vulnerability could allow an attacker to gain unauthorized control over the git commands executed by the go-git library. This could potentially lead to arbitrary code execution, data manipulation, and unauthorized access to sensitive repositories, significantly compromising the integrity and security of affected systems.

 

Active Exploitation

At this time, there is no public evidence of active exploitation by known adversary groups. However, the potential for exploitation remains high given the critical nature of the vulnerability. Security teams and developers are advised to remain vigilant and apply patches promptly.

 

Ransomware Association

While there are no direct indications linking this specific vulnerability to ransomware attacks, the nature of the flaw enabling arbitrary code execution presents a pathway that ransomware operators could exploit to gain initial access and deploy their malware on compromised systems.

 

Mitigation and Resolution

A patch addressing this vulnerability has been released in go-git v5.13.0. Users and administrators are strongly advised to update to this version immediately to mitigate the risks associated with CVE-2025-21613.

 

Recommendations

  • We strongly recommend that all customers apply the latest patch as soon as possible.
  • Ensure you are using go-git version 5.13.0 or later.
  • Review dependencies and update them accordingly to prevent potential vulnerabilities from upstream packages.
  • Employ additional security measures such as input validation and command sanitization to prevent similar issues.
  • Monitor your systems for any unusual activity that may indicate exploitation attempts.

Referencesย 

 

View In Platform

https://vi.securin.io/vulnerability/detail/cve-2025-21613

Share This Post On