The clone ran the hook
On November 10, Git shipped 2.56.1 and six backports to fix CVE-2026-111760: a repository with an extremely long path can swap a submodule's .git file for a symlink to attacker hooks, and git runs them during a recursive clone. Coding agents clone repositories with their submodules all day. In Bromure Agentic Coding, that hook runs in a VM with stand-in credentials and a default-deny network, the Security Timeline shows the hook's process chain back to the agent's git clone, and Rewind home takes the clone and anything it left out of the machine.
The agent ran git clone --recursive. It approved nothing else, opened
no file and installed no package. Git ran the repository's hook while
the clone was still going.
On November 10, the Git project released Git 2.56.1, with backports to 2.55.1, 2.54.1, 2.53.1, 2.52.1, 2.51.3 and 2.50.2. The release fixes six vulnerabilities. GitHub's write-up and The Hacker News lead with one of them, CVE-2026-111760: code execution during a recursive clone.
Before git writes a path into a working tree, it checks that the path
doesn't overwrite git's own metadata. An integer truncation in the code
that handles the index lets an extremely long path pass that check under
one name and land on disk under a shorter one. The attacker picks the
shorter name, which can be .git.
In a freshly cloned submodule, .git is a file that points at the
submodule's repository, not a directory. Git refuses to replace a .git
directory with a symlink, and it has no such rule for a .git file.
The malicious repository replaces it with a symlink to a directory the
attacker controls, full of hooks and config. When the recursive clone
gets to that submodule, git uses the attacker's directory, and the hook
runs as the user who typed the clone.
This is the third bug of this kind in three years. CVE-2024-32002 used case-insensitive filesystems to write a hook through a submodule symlink. CVE-2025-48384 used a trailing carriage return in a submodule path, and CISA added it to its list of exploited vulnerabilities. Each fix closed one way to get a hook into a submodule's git directory.
GitHub's interim advice is "avoid recursive clones of untrusted repositories," until you've patched every copy of git you have.
Agents clone with submodules
"Clone this repository and get the build working" is one of the most
common things people ask a coding agent. The agent runs git clone, the
build fails because vendor/ or third_party/ is empty, and it runs
git submodule update --init --recursive, or it goes straight to
git clone --recursive because the README says to. Both reach the
vulnerable code.
Agents also clone repositories nobody on the team has looked at yet: the
library in a stack trace, the minimal reproduction attached to an issue,
the fork a pull request came from, the "example project" a blog post links
to. Teams often let agents run git clone without asking, since a clone
downloads files and runs nothing. With this bug, the hook has run by the
time the clone finishes.
Git starts the hook, and it runs as the developer with whatever access
the agent's shell has. On a Mac, that user can read ~/.ssh, ~/.aws, ~/.config/gh, ~/.npmrc, every
.env in every checkout and the browser's cookies.
Then there's patching. A developer Mac has several copies of git: the
one in Apple's command-line tools, which Apple updates on its own
schedule, Homebrew's, the ones bundled in GitHub Desktop and the GitHub
Copilot app (GitHub says patched builds are "being prepared"), and the
ones some IDEs ship. When THN checked, Git for Windows had no release
based on 2.56.1 yet. An agent uses whichever git is first on its
PATH, so you have to update all of them.
The same clone in Bromure Agentic Coding
Bromure Agentic Coding runs Claude Code, Codex, Grok, Kimi and omp in Ubuntu VMs on your Mac, one VM per machine. The agent's shell, its git and everything git starts run inside that VM. Credentials inside it are stand-ins, and every connection it makes passes through a virtual switch and a proxy on the Mac.
Take the worst case: an unpatched git, a malicious repository, and an
agent that runs git clone --recursive without asking anyone. The hook
runs, inside the machine.
It runs in a VM, away from your Mac's files
The hook runs as ubuntu in a Linux home that holds the machine's
checkouts, package caches and shell history. Your Mac's home folder,
Keychain and browser profiles aren't in the VM. The VM sees only the
folders you chose to share with it.
When you start a session from a repository URL, the clone also runs in the machine. On machines that use the OpenShell engine, Bromure's own git calls in the VM always run inside the guest sandbox, because, in the manual's words, "a repository can point git at a program of its choosing."
The credentials it finds are stand-ins
A hook written to steal credentials finds them all in the usual places,
in the format each tool expects, and every one is a stand-in. A
ghp_ token GitHub never issued, an ANTHROPIC_API_KEY that starts with
sk-ant-api03-brm-, an AWS secret key that's fake. The real values stay
encrypted on the Mac, and the proxy swaps a stand-in for its real value
only on requests to the hosts that credential belongs to.
There's no private key to copy either. The VM's SSH_AUTH_SOCK is a
bridge to an agent on the Mac. It can list keys and ask for signatures,
and the key bytes never enter the VM.
It has nowhere to send them
Every connection out of the VM goes through the Mac. Set the Bromure Firewall's Unmatched traffic to Deny and the machine reaches the hosts on its list and nothing else. Or switch the machine to OpenShell + Sentry: its starter policy allows GitHub, npm and PyPI read-only, plus Ubuntu's mirrors, and denies everything else. A hook that calls home to its own server gets a refusal and a red row in the Security Timeline.
With Enforce binaries on, a root-owned attestor in the VM ties every
connection to the program that opened it, and each rule names the
programs allowed to use it. The refusal tells you which rule and which
program, so a curl started by a hook shows up as curl, not as git.
If the hook tries to reuse a token, it gets nothing out of it. Sent to
any host other than the one it belongs to, a stand-in is caught by the
proxy, which answers HTTP 451, pauses the VM, and opens an alert titled
This environment may have been compromised, naming the credential
and both hosts. Sent to GitHub, it can't push a backdoor into your other
repositories: new machines put every forge in Prompt before write,
so a git push from the VM waits for you to approve it in a dialog on
the Mac.
The agent watchdog watches the session from outside the VM: bursts of blocked requests, credentials that don't belong, new destinations once the session has settled. Set to Quarantine, it cuts the network and pauses the VM within milliseconds.
It can only touch the files the policy allows
Under OpenShell, a filesystem_policy confines what the agent and every
process it starts may read and write, with Linux Landlock. Even root in
the VM can't lift it. The hook inherits that from the agent's
git clone, so when it goes looking in folders the policy doesn't
list, it gets "permission denied." Each refusal is a
Guest sandbox row in the Timeline, and an alarm fires when one
program hits its limits 20 times in a minute.
You can see which clone ran it
The agent's transcript shows one git clone that succeeded. The hook
never went through a tool call, so the agent has no record of it.
On a machine with the kernel sentry, a small kernel module reports
every program launch and every connection from inside the VM's kernel,
over a channel the agent can't silence. Double-click the refused
connection in the Security Timeline and its network lineage opens:
the prompt you gave, the agent's reasoning and stated intent, the tool
call (Bash, git clone --recursive …, exact match), and the process
chain from claude through bash and git down to the hook and the
program it started. Other flows from this tool call lists everything
else that clone connected to.
That row gives you the repository, the prompt that sent the agent to it, and the host the hook tried to reach.
Undoing it
The malicious clone, its symlinked hook folder and anything the hook
wrote to ~/.bashrc or ~/.config all live in the machine's home, which
is its own disk image. Bromure takes a copy-on-write checkpoint of it on
the first successful boot of each day. Shut the machine down, open
⋯ › Rewind home…, and pick a point from before the clone. The next
start comes up with the home as it was then. The current home is kept as
a new point in the same list, so you can still go back for a file.
If the hook reached the system disk with sudo, Reset disk re-clones
it from the signed base image and leaves the home alone. For a
repository you don't trust at all, bromure-cli vm run --rm gives you a
throwaway machine that is deleted when it stops: clone it there, look,
and let it go.
One git to patch per machine
The agent's git is Ubuntu's git package in the VM, not the one from
Apple, Homebrew or an app bundle. Updating it is
sudo apt install --only-upgrade git in the machine, and every .deb
download is a Supply chain row in the Timeline, so you can check
which machines fetched the new one. When Bromure publishes a new base
image, each machine offers the upgrade on its next start, and Yes,
upgrade moves its system disk onto the new image without touching the
home.
Nothing worth stealing
The hook finds stand-in tokens, an SSH bridge with no key bytes, and no Mac home. A stand-in sent to the wrong host pauses the VM.
Nowhere to go
Default deny on the Mac refuses the hook's server, and a push to GitHub waits for your OK in a dialog on the Mac.
One row tells the story
The kernel sentry ties the refused connection to the hook, to git, to the agent's clone, and to the prompt that asked for it.
Rewind past it
Rewind home takes the clone and what it wrote out of the machine. Reset disk restores the system disk from the base image.
What to do this week
- Update git to 2.56.1 or a fixed backport everywhere you have a copy: Homebrew, your Linux machines, CI images, and any app that bundles git. Check Apple's command-line tools, GitHub Desktop and the Copilot app for updates as they ship.
- Until then, don't clone untrusted repositories with
--recursiveor rungit submodule update --initin them, and takegit cloneoff your agents' list of commands that run without asking. - On GitHub Enterprise Server, move to 3.19.15, 3.20.11, 3.21.9 or 3.22.4.
Then give your agents a machine where a hook that runs during a clone finds nothing to steal and nowhere to send it, and where removing what it left takes a rewind. Setting default deny, OpenShell policies and the kernel sentry is covered in the Sandbox Policy chapter of the manual.