A base commit could make Git read a repository config from inside the audit base snapshot
Description
Impact
fallow audit, the programmatic audit and the MCP audit tool analyze the base commit in a temporary snapshot. Fallow removes the Git registration of this snapshot. The .git file of the snapshot then named a relative path, fallow-audit-unregistered. Git resolved that path inside the snapshot, which holds the content of the base commit.
A base commit could supply a directory at that path, or a directory shaped as a bare repository. A Git command with its working directory in the snapshot could then read the config of that directory. Some Git config keys run commands, for example core.fsmonitor.
Reachability in released versions:
- The CLI audit runs no Git command inside the snapshot after it removes the registration.
- The programmatic and MCP audit ran
git rev-parse --git-dirinside the snapshot. This command does not runcore.fsmonitor. - With the
diff_file,changed_sinceorchanged_workspacesoptions, the programmatic audit could also run the Git commands of the changed-files lookup inside the snapshot.
We did not show a command that runs through a released code path. We treat the issue as a hardening fix with a security effect.
Patches
Fixed in 3.37.0. The .git file now names an absolute path that cannot exist. Each Git command inside a snapshot gets a GIT_DIR that does not exist and a GIT_CEILING_DIRECTORIES limit. Every Git command that Fallow starts also uses safe.bareRepository=explicit.
Workarounds
Do not run the programmatic or MCP audit with diff_file, changed_since or changed_workspaces against a base commit that you do not trust.