Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
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.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
vfs-hook-impersonate — VFS for Git ab95cf51 - High - Local - Privilege leftover - hook CreateFileW SecurityImpersonation | Kitploit
Tools/GitHubGitHub/abraxas/vfs-hook-impersonate
Privilege EscalationVulnerability AnalysisExploitationPenetration TestingPapers & ResearchRed TeamingLabs & Practice
GitHubabraxas/vfs-hook-impersonate

vfs-hook-impersonate

VFS for Git ab95cf51 - High - Local - Privilege leftover - hook CreateFileW SecurityImpersonation

View Repository
54 days 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

Abraxas Labs - vfs-hook-impersonate

abraxaslabs.tech  ·  github.com/abraxas  ·  @abraxas_null  ·  [email protected]  ·  vfs-hook-impersonate

vfs-hook-impersonate

Class: Privilege leftover Reach: Local

VFS for Git master ab95cf51 (tag v2.0.26259.1) - Microsoft

Native git hooks (read-object, virtual-filesystem, post-index-changed) open the per-enlistment mount pipe with CreateFileW and dwFlagsAndAttributes = 0. That omits SECURITY_SQOS_PRESENT, so Windows defaults the client to SecurityImpersonation. The same pipe ACL that leftover #2 uses grants BUILTIN\Users ReadWrite | CreateNewInstance.

A second local user can extra-instance or squat \\.\pipe\GVFS_<ENLISTMENT>, ImpersonateNamedPipeClient, and write as the victim.

IDno CVE yet
ClassPrivilege leftover (named-pipe impersonation)
ReachLocal
CWECWE-284, CWE-300
CVSSHigh: 7.1 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
ProductVFS for Git
Affectedmaster ab95cf51d6ffd0ee0e2feae7180078fe9ecbbb3a (also current vs release v2.0.26259.1). Windows only.
AuthLocal. Victim has a GVFS enlistment. Attacker is any BUILTIN\Users principal. Victim later runs git.
LicenseGNU Affero GPL v3.0
Lab127.0.0.1 only. how=gadget (no live Windows VM / installed VFS for Git).

This is local. It is not SYSTEM. Automount in leftover #4 is a different pipe (GVFS.Service.pipe). Dehydrate/unmount on this same mount pipe is leftover #2.

What an attacker can do

Victim has a GVFS enlistment. Attacker is any BUILTIN\Users principal. Victim later runs git (status, checkout, anything that fires the VFS hooks).

PrivilegeMethod / sinkWhat it grantsRecon / integrity / availabilityLab-proven or inferred
Impersonate the victim and write into their profileExtra-instance / squat \\.\pipe\GVFS_C_\REPOS\FOO; hook CreateFileW flags=0; ImpersonateNamedPipeClient; create %USERPROFILE%\VFS-HOOK-IMPERSONATE-WITNESSWrite as the victim UIDIntegrityLab-proven on a gadget. Witness owner is the victim uid. Default flags are SecurityImpersonation. Attacker uid cannot write that home without impersonation
Keep git working after the squatReply S|\x03 to MPL|1 so GVFS.VirtualFileSystemHook does not hangGit continuesAvailability of the victim gitLab-proven. Hook reply_ok on both vuln and patched paths
Guess the pipe name from the enlistment rootGetGVFSPipeName walks CWD to .gvfs, CharUpper, : -> _, prefix \\.\pipe\GVFS_Guessable IPC nameReconLab-proven. C:\Repos\Foo\src -> \\.\pipe\GVFS_C_\REPOS\FOO
Retarget the pipe without winning the live instancePlant a tracked src\.gvfs directory so the walk-up binds a different nameSquatting without racing the mountIntegrityInferred from common.windows.cpp walk-up. Lab used the real enlistment .gvfs
Answer DLO / PICN as well as MPLSame pipe, ReadObjectHook / PostIndexChangedHookLie about objects / skip-worktreeIntegrityInferred. Lab sent MPL|1 only
Crash the hook with a two-byte S\x03VirtualFileSystemHook messageLength -= 2 then -= 1 underflows and fwrites ~4GiBCrash / OOB readAvailabilityInferred from main.cpp 69-90. Not the oracle. Do not ship that crash

Closed here: SYSTEM (mount is the enlistment user). Remote unauthenticated RCE. Live Windows VM / installed VFS for Git (this lab is a gadget of the copied functions).

Same pin leftovers: vfs-quote-breakout, vfs-mount-dehydrate, vfs-clone-acl, vfs-service-sid, vfs-install-cwd.

How I found it

I pinned VFSForGit master ab95cf51 after the 2026-09-28 merge. Native hooks CreateFileW with flags 0. Windows then defaults to SecurityImpersonation. The mount pipe already lets Users extra-instance. That is the leftover.

Wrong turns already recorded: treating this as leftover #2 dehydrate (same ACL, different sink: token, not MoveDirectory); claiming SYSTEM; shipping the 4GiB underflow as the oracle. Theatre. Native Windows was missing, so the lab is a gadget of those functions. Unix sockets stand in for named pipes.

Lab

python3 vfs-hook-impersonate-Abraxas-Labs.py

or

cd lab
./run.sh

Gadget HTTP on 127.0.0.1:19670. Copies GetGVFSPipeName, CreatePipeToGVFS flags, the Users CreateNewInstance ACL, and the MPL|1 / S| hook protocol. A patched client with SQOS identification does not write the witness. Last line uses how=gadget.

SUCCESS vfs-hook-impersonate how=gadget createfile-flags=0 impersonation=SecurityImpersonation extra-instance=yes owner=victim patched-sqos-ident-no-write=yes VFS-HOOK-IMPERSONATE-WITNESS

The fix

On the hook CreateFileW pass SECURITY_SQOS_PRESENT | SECURITY_IDENTIFICATION. Restrict CreatePipeByName to the enlistment owner SID plus LocalSystem. Drop CreateNewInstance for Users. Bound-check hook reply lengths.

References

  • github.com/microsoft/VFSForGit master ab95cf51d6ffd0ee0e2feae7180078fe9ecbbb3a
  • common.windows.cpp CreatePipeToGVFS
  • WindowsPlatform.cs CreatePipeByName
  • CWE-284 · CWE-300

License

GNU Affero GPL v3.0. See LICENSE. Loopback lab only. No warranty.

Download Tool