GHSA-449p-3h89-pw88

Suggest an improvement
Source
https://github.com/advisories/GHSA-449p-3h89-pw88
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/01/GHSA-449p-3h89-pw88/GHSA-449p-3h89-pw88.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-449p-3h89-pw88
Aliases
Related
Published
2024-01-10T15:37:05Z
Modified
2024-01-23T15:58:25.425641Z
Severity
  • 9.8 (Critical) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
Maliciously crafted Git server replies can lead to path traversal and RCE on go-git clients
Details

Impact

A 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.

Applications are only affected if they are using the ChrootOS, which is the default when using "Plain" versions of Open and Clone funcs (e.g. PlainClone). Applications using BoundOS or in-memory filesystems are not affected by this issue. This is a go-git implementation issue and does not affect the upstream git cli.

Patches

Users running versions of go-git from v4 and above are recommended to upgrade to v5.11 in order to mitigate this vulnerability.

Workarounds

In 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.

Credit

Thanks to Ionut Lalu for responsibly disclosing this vulnerability to us.

Database specific
{
    "nvd_published_at": "2024-01-12T11:15:13Z",
    "cwe_ids": [
        "CWE-22"
    ],
    "severity": "CRITICAL",
    "github_reviewed": true,
    "github_reviewed_at": "2024-01-10T15:37:05Z"
}
References

Affected packages

Go / github.com/go-git/go-git/v4

Package

Name
github.com/go-git/go-git/v4
View open source insights on deps.dev
Purl
pkg:golang/github.com/go-git/go-git/v4

Affected ranges

Type
SEMVER
Events
Introduced
4.0.0
Last affected
4.13.1

Go / github.com/go-git/go-git/v5

Package

Name
github.com/go-git/go-git/v5
View open source insights on deps.dev
Purl
pkg:golang/github.com/go-git/go-git/v5

Affected ranges

Type
SEMVER
Events
Introduced
5.0.0
Fixed
5.11.0

Go / gopkg.in/src-d/go-git.v4

Package

Name
gopkg.in/src-d/go-git.v4
View open source insights on deps.dev
Purl
pkg:golang/gopkg.in/src-d/go-git.v4

Affected ranges

Type
SEMVER
Events
Introduced
4.7.1