git-subtree-go treats a subtree repository and its commit messages as
untrusted input.
- A malicious subtree repository, including commit messages, trailers, trees, and refs.
- Untrusted values interpolated into CI commands: prefix, ref, revision, or repository URL.
- A shared or attacker-writable cache/temporary directory.
- Supply-chain compromise of the released binary.
Local Git configuration and hooks are trusted, as they are for every Git command.
-
No shell,
eval, word splitting, globbing, or IFS handling. Every Git command is an explicit argv. -
Prefixes are validated as relative repository paths: no absolute paths, no
.., no.gitcomponents, no control characters, no leading-. -
Refs go through
git check-ref-format; revisions are resolved with--end-of-optionsand must be exactly one commit. -
Repository arguments must not start with
-;ext::transports are rejected.git fetch/git pushreceive--. -
git-subtree-splitvalues are accepted only as full object IDs. A missing object is fetched by exact OID, never by refspec, and must resolve to a commit. This closes the following upstream issue:git-subtree-split: +refs/heads/victim:refs/heads/victimBefore this fix, a squash merge from a malicious repository could run
git fetch <repo> +refs/heads/victim:refs/heads/victimand create or update a local branch. -
Commit messages are parsed as raw bytes;
git-subtree-dirmust match exactly, and line-oriented sentinel formats are not used. -
Trees are parsed from raw NUL-delimited objects, so filenames containing newlines or other delimiters cannot confuse path lookup.
-
Temporary files use
os.CreateTemp(0600); the cache directory is 0700. Cache paths are SHA-256-derived. A per-key advisory lock serialises writers. -
addrefuses to write through a symlinked path component. -
Debug output prints command counters and revision IDs, not commit message bodies or file contents. Git itself may echo a repository URL in normal fetch/push progress, exactly as it does for any Git command.
Report suspected vulnerabilities privately to the Agilicus platform team before opening a public issue.