CVE-2023-49569: Github.com/go git/go git/v5 Remote Code Execution Vulnerability
CRITICALCVE-2023-49569 is a CRITICAL (CVSS 9.8) remote code execution vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Github.com/go git/go git/v5 libraries in the Go ecosystem. The issue involves maliciously crafted git server replies can lead to path traversal and rce on go-git clients. Remediation is available by upgrading affected packages to version 5.11.0.
CVE-2023-49569 at a Glance
Security Impact
CVSS: 9.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2023-49569
To remediate this vulnerability, upgrade all affected Github.com/go git/go git/v5 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/go-git/go-git/v5 to 5.11.0
Upgrade gopkg.in/src-d/go-git.v4 to Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/go-git/go-git/v5
How to Check if You Are Affected
To determine whether your application is affected by CVE-2023-49569, inspect your project dependencies for Github.com/go git/go git/v5:
inspect dependencies for github.com/go-git/go-git/v5
Analyze the terminal output to locate any version of Github.com/go git/go git/v5 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.11.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Github.com/go git/go git/v5, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2023-49569 Affected Github.com/go git/go git/v5 Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/go-git/go-git/v5
|
Go |
≥ 5.0.0
< 5.11.0
|
5.11.0
|
|
gopkg.in/src-d/go-git.v4
|
Go |
≥ 4.0.0
≤ 4.13.1
|
|
References
Frequently Asked Questions
What is CVE-2023-49569?
Which Github.com/go git/go git/v5 versions are affected?
What version fixes CVE-2023-49569?
Is github.com/go-git/go-git/v5 affected?
Is gopkg.in/src-d/go-git.v4 affected?
What is the CVSS score of CVE-2023-49569?
What CWE is associated with CVE-2023-49569?
How can I check Go dependencies for CVE-2023-49569?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-449p-3h89-pw88",
"modified" : "2025-01-06T15:26:30Z",
"published" : "2024-01-10T15:37:05Z",
"aliases" : [ "CVE-2023-49569" ],
"summary" : "Maliciously crafted Git server replies can lead to path traversal and RCE on go-git clients",
"details" : "### Impact\nA path traversal vulnerability was discovered in go-git versions prior to `v5.11`. This vulnerability allows an attacker to create and amend files across the filesystem. In the worse case scenario, remote code execution could be achieved.\n\nApplications are only affected if they are using the [ChrootOS](https://pkg.go.dev/github.com/go-git/go-billy/v5/osfs#ChrootOS), which is the default when using \"Plain\" versions of Open and Clone funcs (e.g. PlainClone). Applications using [BoundOS](https://pkg.go.dev/github.com/go-git/go-billy/v5/osfs#BoundOS) or in-memory filesystems are not affected by this issue.\nThis is a `go-git` implementation issue and does not affect the upstream `git` cli.\n\n### Patches\nUsers running versions of `go-git` from `v4` and above are recommended to upgrade to `v5.11` in order to mitigate this vulnerability.\n\n### Workarounds\nIn cases where a bump to the latest version of `go-git` is not possible in a timely manner, we recommend limiting its use to only trust-worthy Git servers.\n\n## Credit\nThanks to Ionut Lalu for responsibly disclosing this vulnerability to us.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/go-git/go-git/v5"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.0.0"
}, {
"fixed" : "5.11.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "gopkg.in/src-d/go-git.v4"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.0.0"
}, {
"last_affected" : "4.13.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/go-git/go-git/security/advisories/GHSA-449p-3h89-pw88"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-49569"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/go-git/go-git"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2024-01-10T15:37:05Z",
"nvd_published_at" : "2024-01-12T11:15:13Z"
}
}