GHSA-qgq7-7hm3-q39j: Path Traversal

Published Aug 7, 2026
·
Updated

Impact A path traversal issue in go-git could allow malicious reference names to access files outside the repository's intended reference storage.

Loose references are stored under .git/<reference-name>. The reference name was previously used as a path without verifying that the resolved path remained within the reference storage. A name such as refs/heads/../../config could therefore resolve to unrelated repository metadata such as .git/config or .git/HEAD.

A malicious Git server could advertise such a reference name. The name may also survive refspec mapping; for example, it could be mapped to refs/remotes/origin/../../config during a clone or fetch operation.

This vulnerability affects filesystem-backed repositories using the storage/filesystem package and its dotgit reference storage. Users relying exclusively on the in-memory storage implementation, storage/memory, are not affected, because reference names are not resolved as filesystem paths.

Exploitation requires an application using go-git with filesystem-backed storage to interact with a malicious Git server or otherwise process attacker-controlled reference names.

Patches The issue has been addressed by validating reference names at the dotgit storage entry points and rejecting names whose resolved paths could escape the reference storage.

Users of filesystem-backed storage should upgrade to a patched version.

Workarounds Applications that exclusively use storage/memory are not affected and do not require a workaround for this vulnerability.

For applications using filesystem-backed storage, avoid cloning from or fetching from untrusted Git servers until an upgrade is possible.

Applications that directly construct or process reference names may also validate them before passing them to filesystem-backed go-git storage. Application-level validation should only be considered a temporary mitigation and does not replace upgrading to a patched version.

References - Fixes: - https://github.com/go-git/go-git/pull/2247 - https://github.com/go-git/go-git/pull/2254

Credits

Thanks to @Saku0512 for reporting this issue and @Sahana2524 for proposing the initial fix. 🙇

Affected Software

2 affected componentsFixes available
go/github.com/go-git/go-git/v6<=6.0.0-alpha.4
6.0.0-alpha.5
go/github.com/go-git/go-git/v5<=5.19.1
5.19.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/go-git/go-git/v6 to a version that resolves this vulnerability.

    Fixed in 6.0.0-alpha.5
  2. Upgrade

    Upgrade go/github.com/go-git/go-git/v5 to a version that resolves this vulnerability.

    Fixed in 5.19.2
  3. Upgrade

    Upgrade go-git/go-git to a version that resolves this vulnerability.

    Patch https://github.com/go-git/go-git/pull/2247
  4. Upgrade

    Upgrade go-git/go-git to a version that resolves this vulnerability.

    Patch https://github.com/go-git/go-git/pull/2254
  5. Compensating control

    For applications using go-git with filesystem-backed storage (storage/filesystem), avoid cloning from or fetching from untrusted Git servers until an upgrade is possible.

Event History

Aug 7, 2026
Advisory Published
via GitHub·04:41 PM
Data Sourced
via GitHub·04:41 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of GHSA-qgq7-7hm3-q39j?

The severity of GHSA-qgq7-7hm3-q39j is medium, rated at 6.3.

2

How do I fix GHSA-qgq7-7hm3-q39j?

To fix GHSA-qgq7-7hm3-q39j, update to the latest version of the go-git library that addresses the path traversal vulnerability.

3

What type of vulnerability is GHSA-qgq7-7hm3-q39j?

GHSA-qgq7-7hm3-q39j is classified as a path traversal vulnerability.

4

What impact does GHSA-qgq7-7hm3-q39j have on my application?

GHSA-qgq7-7hm3-q39j could allow malicious reference names to access files outside of the intended storage in your application.

5

Which software versions are affected by GHSA-qgq7-7hm3-q39j?

GHSA-qgq7-7hm3-q39j affects go-git versions 5 and 6.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203