CVE-2026-71556: go-git Worktree Operations May Follow Symlinks Vulnerability
HIGHCVE-2026-71556 is a HIGH (CVSS 7.1) worktree operations may follow symlinks vulnerability (CWE-59: Improper Link Resolution Before File Access ('Link Following')) affecting go-git libraries in the Go ecosystem. The issue involves worktree operations may follow symlinks. Remediation is available by upgrading affected packages to version 5.19.2, 6.0.0-alpha.5.
CVE-2026-71556 at a Glance
Security Impact
CVSS: 7.1
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:R/S:U/C:N/I:H/A:L).
How to Fix CVE-2026-71556
To remediate this vulnerability, upgrade all affected go-git 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.19.2
Upgrade github.com/go-git/go-git/v6 to 6.0.0-alpha.5
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-2026-71556, inspect your project dependencies for go-git:
inspect dependencies for github.com/go-git/go-git/v5
Analyze the terminal output to locate any version of go-git in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.19.2), 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-59: Improper Link Resolution Before File Access ('Link Following'), where the product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. In go-git, 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-2026-71556 Affected go-git Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/go-git/go-git/v5
|
Go |
< 5.19.2
|
5.19.2
|
|
github.com/go-git/go-git/v6
|
Go |
< 6.0.0-alpha.5
|
6.0.0-alpha.5
|
References
Frequently Asked Questions
What is CVE-2026-71556?
Which go-git versions are affected?
What version fixes CVE-2026-71556?
Is github.com/go-git/go-git/v5 affected?
Is github.com/go-git/go-git/v6 affected?
What is the CVSS score of CVE-2026-71556?
What CWE is associated with CVE-2026-71556?
How can I check Go dependencies for CVE-2026-71556?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hc8v-wwc9-vgxm",
"modified" : "2026-08-07T16:38:15Z",
"published" : "2026-08-07T16:38:15Z",
"aliases" : [ "CVE-2026-71556" ],
"summary" : "go-git: Worktree operations may follow symlinks",
"details" : "## Impact\n\nA symlink traversal issue in `go-git` could allow worktree operations to modify files outside the intended worktree path.\n\nThe `worktreeFilesystem` wrapper rejected dangerous path strings, including paths containing `.git`, parent-directory components, or control characters. However, it did not prevent filesystem operations from following symbolic links that were already present in the worktree.\n\nAs a result, a path that is safe when evaluated as a string could still resolve into the repository's Git metadata directory. For example, if `s` is a symbolic link to `.git`, writing to `s/config` would modify `.git/config`.\n\nA symbolic link at the final path component could also be followed. For example, if `s` points directly to `.git/config`, opening `s` for writing with truncation could overwrite the repository configuration.\n\nExploitation requires an attacker to be able to introduce or control a symbolic link in the worktree and cause the application to perform a write through that path.\n\nApplications using `storage/memory` for their Storer, or `go-billy/memfs` for their `Worktree`, are not affected by this vulnerability.\n\n## Patches\n\nThe issue has been addressed by making the worktree filesystem wrapper a symlink-safe boundary.\n\nWorktree operations now reject paths where an existing symbolic link in any path component could cause the operation to escape the intended worktree location, including symbolic links at the final component.\n\nUsers of filesystem-backed worktrees should upgrade to a patched version.\n\n### Credits\n\nThanks to @kodareef5 for reporting this issue and working with the go-git security team toward its resolution. :1st_place_medal: \nWe would also like to thank @HughLewis20, who independently reported the same issue while a fix was already in progress.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/go-git/go-git/v5"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.19.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 5.19.1"
}
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/go-git/go-git/v6"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "6.0.0-alpha.5"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 6.0.0-alpha.4"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/go-git/go-git/security/advisories/GHSA-hc8v-wwc9-vgxm"
}, {
"type" : "WEB",
"url" : "https://github.com/go-git/go-git/commit/008a78f2dd86f52544ddff8b8e8ddeecdf3f7aab"
}, {
"type" : "WEB",
"url" : "https://github.com/go-git/go-git/commit/661d1c7f101d34e002a3cfcf8dbea5b7421d07ac"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/go-git/go-git"
}, {
"type" : "WEB",
"url" : "https://github.com/go-git/go-git/releases/tag/v5.19.2"
}, {
"type" : "WEB",
"url" : "https://github.com/go-git/go-git/releases/tag/v6.0.0-alpha.5"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-59" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-08-07T16:38:15Z",
"nvd_published_at" : null
}
}