GHSA-3wxw-xv34-2frg: Infoleak

Published Sep 8, 2026
·
Updated

Summary TagReference.create() forwards a caller-influenced positional reference value into git tag without it ever being inspected by the unsafe-option guard, allowing an arbitrary file read (the file's contents are returned in-band as the annotated tag message). This is an incomplete-fix bypass of commit 3af0c251 (the fix for GHSA-3f7w-8rr8-f37f's tag instance).

Root Cause The fix 3af0c251 added unsafegittagoptions = ["--file","-F"] and a guard call, but the guard is Git.checkunsafeoptions(options=Git.optioncandidates([], kwargs), unsafeoptions=...) at git/refs/tag.py:139 — it passes an EMPTY args list and inspects kwargs only. The dangerous values path and reference are POSITIONALS (args = (path, reference), tag.py:156), placed before any --. A user-influenced reference="--file=<path>" therefore reaches git tag as the exact --file option the fix intended to block, creating an annotated tag whose message is the file's contents.

Impact Arbitrary local file read at the privileges of the host process; contents returned in-band via tagref.tag.message. Requires the embedding application to forward a caller-influenced reference value into TagReference.create() (pure VALUE control — the CVE-2026-42215 threat model). Default allowunsafeoptions=False.

Proof of Concept python from git import TagReference t = TagReference.create(repo, "vpwn", reference="--file=/home/app/.ssh/idrsa") print(t.tag.message) # contents of the file

Attack Chain 1. Entry: app calls TagReference.create(repo, name, reference=<user>) with reference="--file=/home/app/.ssh/idrsa". 2. Check: Git.checkunsafeoptions(optioncandidates([], kwargs), ["--file","-F"]) @ tag.py:137-141. Guard: denylist includes --file/-F. Bypass proof: optioncandidates receives args=[] → the positional reference is never a candidate (the kwarg spelling file="…" IS blocked; only the positional escapes). 3. Sink: repo.git.tag(args, kwargs) @ tag.py:158 → no --. argv (observed): ['git','tag','-f','vpwn','--file=<secret>']. 4. Impact: annotated tag created; tagref.tag.message == file contents (arbitrary file read).

Bypass Evidence Independently reproduced (independent test harness, git 2.43.0, default allowunsafeoptions=False): TagReference.create(repo,'vp','--file=<secret>') → PASSED; tag.message == 'GATESECRETLINEA\nGATESECRETLINEB'. Control: TagReference.create(..., file='<secret>') → UnsafeOptionError: --file is not allowed. Fix-commit read: 3af0c251 adds optioncandidates([], kwargs) (empty args → positional never a candidate).

Affected Versions GitPython <= 3.1.58 (sink present verbatim on the latest release tag; git diff 3.1.57..HEAD touches only test files).

Suggested Fix Include the positional reference (and path) in the option-candidate list passed to checkunsafeoptions, or place a -- separator before the positional arguments in TagReference.create().

--- Reported by zx (Jace) — GitHub: @manus-use

Affected Software

1 affected componentFixes available
pip/GitPython<=3.1.58
3.1.59

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/GitPython to a version that resolves this vulnerability.

    Fixed in 3.1.59
  2. Upgrade

    Upgrade GitPython to a version that resolves this vulnerability.

    Fixed in 3.1.57Patch 3af0c251
  3. Configuration

    Ensure TagReference.create uses the default allow_unsafe_options=False (i.e., do not override it to true) so unsafe options like --file/-F are denied.

    GitPython TagReference.create / Git.check_unsafe_options allow_unsafe_options = false
  4. Configuration

    Apply the fix-commit behavior so the unsafe-option guard inspects positional arguments: include the positional reference (and path) in the option-candidate list passed to Git.check_unsafe_options (rather than calling it with an empty args list), or insert a `--` separator before positional arguments in TagReference.create().

    GitPython tag.py (unsafe option guard) unsafe_git_tag_options = ["--file","-F"]
  5. Compensating control

    If you control the embedding application inputs, place a `--` separator before any positional arguments passed to TagReference.create()/repo.git.tag so that user-controlled values cannot be interpreted as `git tag` options (e.g., `-- <path> <reference>`).

Event History

Sep 8, 2026
Advisory Published
via GitHub·07:42 PM
Data Sourced
via GitHub·07:42 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which deployments are exposed?

Deployments are exposed when an embedding application passes a caller-influenced reference value to GitPython's TagReference.create(). The issue affects the positional reference argument rather than keyword options.

2

What does an attacker need to exploit this?

An attacker needs control over the reference value that the application forwards to TagReference.create(). Supplying a value such as --file=<path> causes it to be interpreted by git tag as a file option.

3

What can an attacker obtain?

The attacker can read arbitrary local files accessible to the host process running the application. The file contents are returned in-band through the annotated tag message, via tagref.tag.message.

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