Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Victim must actively run GitHacker against the attacker's URL (UI:R); exfiltration is hex-fragment-limited, no write primitive confirmed (C:L, I:N, A:N).
Primary rating from Vendor (https://github.com/WangYihang/GitHacker).
CVSS VectorVendor: https://github.com/WangYihang/GitHacker
Lifecycle Timeline
2DescriptionCVE.org
Summary
GitHacker through 1.1.7 did not validate path segments parsed from attacker-controlled .git/HEAD before joining them onto its output directory. A malicious server could coerce GitHacker into reading arbitrary local files. Contents do not stream back wholesale, but the recovery loop turns any 40-character hex substring into an outbound HTTP GET - an existence oracle for arbitrary paths plus hex-fragment exfiltration of file contents.
Details
Vulnerability
GitHacker rebuilds a remote .git/ by fetching files into temp_dst. Two functions derived filesystem paths from server-controlled content:
add_head_file_tasksreads the downloaded.git/HEAD, parsesref: <ref-path>, and joins the raw ref-path ontotemp_dst/.git/logs/before reading the resulting file.add_hashes_parsedscans any file it reads for 40-character hex substrings and emitsGET .git/objects/<sha[0:2]>/<sha[2:]>for each one - onto the attacker's server and into the local output tree.
Pre-fix, add_head_file_tasks did not validate the ref segments. A malicious .git/HEAD of
ref: ../../../../../../etc/passwdcaused add_head_file_tasks to traverse out of temp_dst and read /etc/passwd. The bytes flowed into add_hashes_parsed, which emitted one outbound HTTP request per 40-char-hex match - observable on the attacker's logs.
Impact
PR #65 originally classified this as arbitrary local file read. Joint analysis during coordinated disclosure narrowed the primitive: file contents do not stream back wholesale because the only egress channel is the 40-char-hex regex. In practice an attacker can:
- Existence oracle for any path on the GitHacker host (
/etc/shadow,/root/.ssh/id_rsa,/home/<user>/.git-credentials, build artifacts under/tmp/). - Hex-fragment exfiltration when the targeted file contains 40-char hex sequences: other git repos' refs / pack filenames, password hashes, HMAC-SHA1 outputs, some session tokens.
Not exploitable without victim action: the attacker must persuade the victim to run GitHacker against a URL they control. Project guidance has always been to run GitHacker inside a disposable container.
Scoping note: no write-side primitive in 1.1.7
A working write-side primitive (attacker drops content outside temp_dst via add_folder / add_task) does not reproduce against the shipped 1.1.7 source. Empirical testing by the reporter against GitHacker-1.1.7.tar.gz (25 traversal-style payloads including ....//, %2e%2e%2f, layered foo/../../, NUL bytes, backslash variants, absolute paths) yielded 0/25 escapes. Two structural reasons:
add_folderanchors every derived path onself.url + '.git/', so the first path component after theurl_lengthstrip is always.git.os.path.join's absolute-path short-circuit never fires.- Python's
str.replace("..", "")is greedy non-overlapping;....//collapses to//,......//to///, etc. No literal..survives intoadd_task.
5f2a8ba is still the correct fix for the read-side primitive and additionally hardens add_task as defense in depth against future regressions - for example, if a later caller removes the .git/ anchor in add_folder or wires a new server-controlled segment source into add_task.
Fix
Commit 5f2a8ba introduces _is_safe_path_segment as a single trust boundary: every segment about to be joined onto temp_dst or appended to an outgoing URL is validated against an allowlist before add_task accepts it. Empty / . / .. / separators / NUL / control characters are rejected; the brittle replace("..", "") filter is removed.
The fix also tightens adjacent surfaces preemptively:
add_folderswitches tourlparse-based scheme + netloc + path comparison.construct_url_from_path_componentspercent-encodes every segment.
PR #65's two-layer defense (allowlist regex + os.path.realpath() confinement) was consolidated onto the allowlist applied at queue-time, removing the TOCTOU window an after-the-fact realpath() check leaves open and the per-call-site drift risk. PR #65 was closed in favour of the broader fix.
Regression tests in tests/test_ref_validation.py (commit 16fcd81) pin the PoC and six bypass variants (extra-depth, mid-path, NUL, absolute path, leading-dot, .lock-suffix).
Credit
Reported and patched-prototyped by Zac Wang (@7a6163) in #65. Zac refined the impact framing from "arbitrary file read" to "existence oracle + hex-fragment exfiltration" and verified the absence of a write-side primitive against the shipped 1.1.7 sdist with a 25-payload harness.
Patches
Patched in 1.1.8 (commit 5f2a8ba; tests 16fcd81).
Workarounds
Run GitHacker inside a disposable container. Do not point GitHacker at any URL whose contents are not under your control.
Resources
- https://github.com/WangYihang/GitHacker/pull/65
- https://github.com/WangYihang/GitHacker/commit/5f2a8ba
- https://github.com/WangYihang/GitHacker/blob/main/tests/test_ref_validation.py
- https://githacker.pages.dev/security
- https://github.com/justinsteven/advisories
- https://drivertom.blogspot.com/2021/08/git.html
AnalysisAI
Path traversal in GitHacker ≤1.1.7 allows a malicious git server to coerce the tool into reading arbitrary files from the victim's local filesystem via an unsanitized ref: value in a crafted .git/HEAD. The exploitable primitive is narrower than full arbitrary file-read: the recovery loop converts every 40-character hex substring in any accessed file into an outbound HTTP GET back to the attacker's server, yielding an existence oracle for arbitrary paths and hex-fragment exfiltration for files containing cryptographic material such as password hashes, HMAC-SHA1 outputs, or SSH key fingerprints. …
Unlock full vulnerability intelligence
- Risk assessment & exploitation conditions
- Attack chain visualization
- Remediation with exact patch versions
- Threat intelligence from 22 sources
- Personal watchlist & email alerts
Free forever · No credit card required
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata
Vulnerability AssessmentAI
| Exploitation | The victim must actively invoke GitHacker (versions ≤1.1.7) targeting a URL fully controlled by the attacker - no passive or autonomous network exploitation is possible. … Additional conditions and limiting factors are described in the full assessment. |
| Risk Assessment | The provided CVSS 5.3 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N) contains a notable inconsistency: the advisory explicitly states that exploitation requires the victim to actively run GitHacker against an attacker-controlled URL, which corresponds to UI:R rather than UI:N. … Full risk analysis with EPSS, KEV, and SSVC signal comparison available after sign-in. |
| Exploit Scenario | Full exploit scenario with step-by-step reproduction available after sign-in. |
| Remediation | Upgrade to GitHacker 1.1.8 (patch commit 5f2a8ba: https://github.com/WangYihang/GitHacker/commit/5f2a8ba), which introduces a path-segment allowlist validated at queue-time and removes the previous brittle `replace('..','')` filter. … Detailed patch versions, workarounds, and compensating controls in full report. |
Threat intelligence, references, and detailed analysis are available after sign-in.
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
Same weakness CWE-22 – Path Traversal
View allSame technique Path Traversal
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-78777
GHSA-hr3m-4qwq-3mgc