Skip to content

Security: Agilicus/git-subtree

Security

SECURITY.md

Security notes

git-subtree-go treats a subtree repository and its commit messages as untrusted input.

Threat model

  • 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.

Controls

  • 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 .git components, no control characters, no leading -.

  • Refs go through git check-ref-format; revisions are resolved with --end-of-options and must be exactly one commit.

  • Repository arguments must not start with -; ext:: transports are rejected. git fetch/git push receive --.

  • git-subtree-split values 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/victim
    

    Before this fix, a squash merge from a malicious repository could run git fetch <repo> +refs/heads/victim:refs/heads/victim and create or update a local branch.

  • Commit messages are parsed as raw bytes; git-subtree-dir must 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.

  • add refuses 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.

Reporting

Report suspected vulnerabilities privately to the Agilicus platform team before opening a public issue.

There aren't any published security advisories