Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-71557-poc — Local proof-of-concept for CVE-2026-71557 demonstrating path traversal in go-git filesystem reference storage, including exploit logic and vulnerable-vs-fixed version comparison. | Kitploit
Tools/GitHubGitHub/saku0512/cve-2026-71557-poc
Vulnerability AnalysisExploitationPenetration TestingSupply Chain SecurityLearning & Education
GitHubsaku0512/cve-2026-71557-poc

CVE-2026-71557-poc

Local proof-of-concept for CVE-2026-71557 demonstrating path traversal in go-git filesystem reference storage, including exploit logic and vulnerable-vs-fixed version comparison.

View Repository
51 month agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-71557: go-git Reference Name Path Traversal PoC

日本語版はこちら

Description

This repository contains a safe local proof of concept for CVE-2026-71557, based on go-git's public advisory GHSA-qgq7-7hm3-q39j.

Before the fix, storage/filesystem used a loose-reference name as the path .git/<reference-name> without sufficient validation. A name such as refs/heads/../../config is normalized outside the intended reference subtree and can overwrite .git/config.

This PoC calls the real go-git API and targets only a dummy .git/config created under a temporary directory. It does not contact a Git server, modify an existing repository, or execute arbitrary commands.

Disclaimer

This project is intended only for education and authorized ethical security testing. Do not use it against systems or environments without permission.

Vulnerability Details

  • CVE ID: CVE-2026-71557
  • GitHub Advisory: GHSA-qgq7-7hm3-q39j
  • Type: Path Traversal (CWE-22)
  • Severity: Medium
  • CVSS v3.1: 6.3 (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:L)
  • Affected versions:
    • github.com/go-git/go-git/v5 <= 5.19.1
    • github.com/go-git/go-git/v6 <= 6.0.0-alpha.4
  • Patched versions:
    • v5: 5.19.2
    • v6: 6.0.0-alpha.5
  • Affected storage: the dotgit reference storage in storage/filesystem
  • Unaffected storage: storage/memory

Root Cause

In v5.19.1, DotGit.SetRef passed the reference name directly to setRef as a file name:

root@kitploit:~
fileName := r.Name().String()
return d.setRef(fileName, content, old)

The root of filesystem-backed storage is normally .git. The reference name refs/heads/../../config normalizes to config, turning a reference update into a write to .git/config. A malicious Git server can advertise such a name, and traversal may remain after clone/fetch refspec mapping, allowing the attacker-controlled name to reach this storage path.

The patched implementation validates names at filesystem storage entry points, including SetRef, Ref, and RemoveRef, and rejects names that can escape the reference storage.

Proof of Concept

Requirements

  • Go 1.25 or later, or a Go installation with automatic toolchain download
  • Network access for the initial module download

Reproduce with the vulnerable version

The included go.mod pins vulnerable go-git v5.19.1.

root@kitploit:~
go run .

Expected key output:

root@kitploit:~
[*] go-git version: v5.19.1
[*] crafted reference: refs/heads/../../config
[*] SetReference error: <nil>
[!] VULNERABLE: .git/config was overwritten through the reference name.

The PoC:

  1. Creates filesystem-backed Git storage under an OS temporary directory.
  2. Writes a harmless marker to .git/config.
  3. Passes the hash reference refs/heads/../../config to SetReference.
  4. Verifies that the reference hash replaced the marker.
  5. Removes the temporary directory automatically.

Compare vulnerable and patched versions

The matrix script runs the same PoC against v5.19.1 and v5.19.2 in temporary modules without changing this repository's go.mod.

root@kitploit:~
./scripts/run-version-matrix.sh

Expected classifications:

root@kitploit:~
go-git v5.19.1
[!] VULNERABLE: .git/config was overwritten through the reference name.

go-git v5.19.2
[+] FIXED: the crafted reference was rejected and .git/config stayed intact.

Use -keep if you want to inspect the generated files. The displayed directory is not automatically removed in that mode and must be deleted manually after inspection.

root@kitploit:~
go run . -keep

Scope

This PoC directly exercises the vulnerable filesystem-storage entry point described by the advisory and demonstrates metadata overwrite through path traversal. It does not implement a malicious Git protocol server or the clone/fetch transport path.

Remediation

Upgrade v5 users to v5.19.2 or later and v6 alpha users to v6.0.0-alpha.5 or later. Until an upgrade is possible, do not clone from or fetch from untrusted Git servers with filesystem-backed storage. Applications using only storage/memory are not affected.

References

  • GHSA-qgq7-7hm3-q39j
  • go-git PR #2247 (v6 fix)
  • go-git PR #2254 (v5 backport)
  • v5 fix commit f3d0cc1
  • v5 additional safety commit 3b306ef
Download Tool