CVE-2023-49569 Maliciously crafted Git server replies can lead to path traversal and RCE on go-git clients

Critical 9.8 Published Updated

A path traversal flaw in go-git allows attackers to write files outside the repository, potentially leading to remote code execution on affected clients.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2023-49569?

CVE-2023-49569 is a critical path traversal vulnerability in go-git, published on 12 Jan 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

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 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. This is a go-git implementation issue and does not affect the upstream git cli.

Weakness: CWE-22

Which versions are affected by CVE-2023-49569?

6 open source packages ship an affected version, including github.com/go-git/go-git/v5 and gopkg.in/src-d/go-git.v4. It affects 1 product.

PackageAffectedFixed in
github.com/go-git/go-git/v5 GoFrom 5.0.05.11.0
github.com/go-git/go-git/v5 GoFrom 5.0.05.11.0
github.com/go-git/go-git/v5 GoFrom 5.0.05.11.0
gopkg.in/src-d/go-git.v4 GoFrom 4.0.0 to 4.13.1None
gopkg.in/src-d/go-git.v4 GoFrom 4.0.0 to 4.13.1None
gopkg.in/src-d/go-git.v4 GoFrom 4.7.1None
Linux distribution packages (34)
ceph Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
ceph-base Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
ceph-base-debuginfo Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
ceph-common Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
ceph-common-debuginfo Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
ceph-debuginfo Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
ceph-debugsource Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
ceph-exporter-debuginfo Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
ceph-fuse Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
ceph-fuse-debuginfo Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
ceph-immutable-object-cache Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
ceph-immutable-object-cache-debuginfo Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
ceph-mds-debuginfo Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
ceph-mgr-debuginfo Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
ceph-mib Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
ceph-mon-debuginfo Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
ceph-osd-debuginfo Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
ceph-radosgw-debuginfo Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
ceph-resource-agents Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
ceph-selinux Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
ceph-test-debuginfo Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
cephfs-mirror-debuginfo Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
cephfs-top Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
libcephfs-devel Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
libcephfs2 Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
libcephfs2-debuginfo Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
libcephsqlite-debuginfo Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
librados-devel Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
librados-devel-debuginfo Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
librados2 Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
librados2-debuginfo Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
libradospp-devel Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
libradosstriper1 Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp
libradosstriper1-debuginfo Red Hat:ceph_storage:6.1::el8All versions2:17.2.6-216.el8cp

Products include Go-Git Project Go-Git.

How do I fix CVE-2023-49569?

Upgrade github.com/go-git/go-git/v5 to 5.11.0 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2023-49569 being exploited?

There is no known exploitation of CVE-2023-49569 in the wild and no public exploit code.

Sources

Also known as AZL-33891, AZL-35098, AZL-39592, DEBIAN-CVE-2023-49569, GHSA-449p-3h89-pw88, GO-2024-2456 and 2 more.

Is CVE-2023-49569 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free