Skip to content

fix: neutralize execution-capable config on an unauthenticated cache - #4

Merged
tnunamak merged 1 commit into
mainfrom
fix/neutralize-cache-config
Aug 19, 2026
Merged

fix: neutralize execution-capable config on an unauthenticated cache#4
tnunamak merged 1 commit into
mainfrom
fix/neutralize-cache-config

Conversation

@tnunamak

Copy link
Copy Markdown
Member

Review on the downstream stub (vana-com/vana-sdk#194) caught this, and it applies here too.

The problem

A poisoned policy cache can execute code through its own .git/config while it is being authenticated. core.fsmonitor runs a command during git status — so the cleanliness check was itself an execution vector, firing before validation completed. The *Proxy/*Command, credential.helper and protocol.ext settings are the same class during fetch.

Confirmed by planting core.fsmonitor in a cache and running the checks: the attacker command executed before validation finished.

The fix

policy_git (bootstrap), shared_git (installer) and the hook's copy now pass -c overrides disabling core.fsmonitor, core.hooksPath, core.sshCommand, core.askPass, credential.helper, protocol.ext.allow and uploadpack.packObjectsHook for every command that touches a checkout not yet authenticated.

Environment scrubbing alone was insufficient because these settings live in the cache's own repo-local config, which -c overrides but env -u cannot reach.

Tests

New regression test plants core.fsmonitor in a policy cache and asserts it never fires during validation. Existing coverage unchanged and passing.

Assisted-by: AI

Review on the downstream stub caught this: a poisoned policy cache can execute
code through its OWN .git/config while it is being authenticated. core.fsmonitor
runs a command during `git status`, so the cleanliness check itself was an
execution vector; the *Proxy/*Command and credential hooks are the same class
during fetch.

Confirmed by planting core.fsmonitor in a cache and running the check — the
attacker command executed twice before validation finished.

policy_git now passes -c overrides that disable fsmonitor, hooksPath,
sshCommand, askPass, credential.helper, protocol.ext and packObjectsHook for
every command that touches a cache we have not yet authenticated.

Assisted-by: AI
@tnunamak
tnunamak merged commit df5a0a3 into main Aug 19, 2026
1 check passed
@tnunamak
tnunamak deleted the fix/neutralize-cache-config branch August 19, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant