{"id":"CVE-2026-71556","aliases":["CVE-2026-71556","GHSA-hc8v-wwc9-vgxm","GO-2026-6213"],"related":["CGA-76w3-rghh-v4jj"],"kind":"vulnerability","state":"published","title":"go-git: Worktree operations may follow symlinks","summary":"go-git is an extensible git implementation library written in pure Go. Prior to 5.19.2 and 6.0.0-alpha.5, worktree operations (including checkout, status, and add) resolve symbolic links inside the working tree without confining resolution to the worktree boundary, so a maliciously crafted repository containing a symlink can cause go-git to read from or write to files outside the intended working directory when the repository is cloned and its worktree operations are used. Versions 5.19.2 and 6.0.0-alpha.5.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"go-git is an extensible git implementation library written in pure Go. Prior to 5.19.2 and 6.0.0-alpha.5, worktree operations (including checkout, status, and add) resolve symbolic links inside the working tree without confining resolution to the worktree boundary, so a maliciously crafted repository containing a symlink can cause go-git to read from or write to files outside the intended working directory when the repository is cloned and its worktree operations are used. Versions 5.19.2 and 6.0.0-alpha.5.","source":"cvelist"},{"lang":"en","text":"## 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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Worktree operations may follow symlinks in github.com/go-git/go-git","format":"markdown","source":"go"}],"published":"2026-08-07T16:37:40.058Z","modified":"2026-09-10T20:41:33.140Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L","score":7.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L","score":7.1,"rating":"HIGH"}],"cwes":["CWE-59"],"affected":[{"ranges":[{"version":"< 5.19.2","status":"affected"},{"version":">= 6.0.0-alpha.1, < 6.0.0-alpha.5","status":"affected"}],"vendor":"go-git","product":"go-git","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"5.19.2"}],"ecosystem":"Go","package":"github.com/go-git/go-git/v5","purl":"pkg:golang/github.com/go-git/go-git/v5","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"6.0.0-alpha.5"}],"ecosystem":"Go","package":"github.com/go-git/go-git/v6","purl":"pkg:golang/github.com/go-git/go-git/v6","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"5.19.2"}],"ecosystem":"Go","package":"github.com/go-git/go-git/v5","purl":"pkg:golang/github.com/go-git/go-git/v5","source":"go"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"6.0.0-alpha.5"}],"ecosystem":"Go","package":"github.com/go-git/go-git/v6","purl":"pkg:golang/github.com/go-git/go-git/v6","source":"go"}],"references":[{"url":"https://github.com/go-git/go-git/security/advisories/GHSA-hc8v-wwc9-vgxm","tags":["advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/go-git/go-git/commit/008a78f2dd86f52544ddff8b8e8ddeecdf3f7aab","tags":["fix","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/go-git/go-git/commit/661d1c7f101d34e002a3cfcf8dbea5b7421d07ac","tags":["fix","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/go-git/go-git/releases/tag/v5.19.2","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/go-git/go-git/releases/tag/v6.0.0-alpha.5","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/go-git/go-git","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-08-07T16:58:08.599Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-71556","url":"https://www.cve.org/CVERecord?id=CVE-2026-71556","licence":"CVE Terms of Use","modified":"2026-08-07T16:58:19.113Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hc8v-wwc9-vgxm","url":"https://github.com/advisories/GHSA-hc8v-wwc9-vgxm","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:14.191Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-6213","url":"https://pkg.go.dev/vuln/GO-2026-6213","licence":"CC-BY-4.0","modified":"2026-09-01T03:55:58.377Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-71556","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-71556","licence":"Public domain","modified":"2026-09-10T20:41:33.140Z"}],"updatedAt":"2026-11-25T22:59:31.865Z","epss":{"score":0.00394,"percentile":0.35714,"date":"2026-12-01T12:00:22.000Z"}}