The Code Chi VCS library runs git on behalf of the tool that calls it, inside repositories that tool points it at. A tool trusts it to run the real git, to pass names and paths to git as data, and to answer about the repository it was asked about. If you find a way to break that trust, please report it privately.
- It runs git and nothing else. No public function runs a git command of the caller's choosing.
- It runs the git on absolute
PATHentries only. Empty and relative entries are skipped, so a program namedgitin the working folder, or inside the repository being read, is never run. - Names are never read as options. A revision name beginning with
-gets no answer and git is not run, and a path beginning with-is passed so that git reads it as a path. - An inherited environment does not redirect it. The variables that point git at another repository, object store or config are removed before each call, so git answers about the folder it was asked about.
- Hooks run only when asked.
stage_all,commit_indexandmake_repositoryturn every git hook off for the call.commit_with_hooksruns the repository's pre-commit and commit-msg hooks, and only those. - It never waits on a prompt. Git's terminal credentials prompt is turned off for every git call.
- A hostile git. The library trusts the git program it finds on
PATH. If an attacker controls an absolutePATHentry, they control what runs. - A hostile repository's own configuration. Git reads the repository's config and the user's config as usual. The library removes injected variables; it does not sandbox git.
- Hooks you ask it to run.
commit_with_hooksruns the repository's hooks, which are programs the repository owner wrote. - Windows is less tested. The library builds on Windows, but its tests are not run there yet.
Do not open a public issue. Email security@codedaptive.com. Please include:
- the part affected (the question or type),
- the tag or commit,
- steps to reproduce.
Do not include secrets in a report or an issue.
We will acknowledge the report, work the problem privately and publish the fix in a new tag. The changelog entry for that tag will say what was fixed.
Fixes go into the newest tag only.