splunk / splunk/token-meter

Git delivery honors local aliases and hooks in scanned project checkouts

Open
#36 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
94
Forks
16
Avg merge
1d 12h
Merged PRs (30d)
5

Description

Summary

Git delivery runs git -C <project-root> … for every discovered session project. The runner blocks a denylist of network/mutating verbs and caps output, which is good, but it still honors local repository config.

Git aliases in .git/config override builtins, including rev-parse, reflog, and config. A project checkout whose local config contains alias.rev-parse = !… will execute that command as the Token Meter user on the next scan.

git_delivery_candidates() feeds session project paths straight into that runner (token_meter/app.py). Those paths are whatever the coding agent recorded, including untrusted clones.

Vanilla git clone from GitHub does not copy the remote’s local config, so this is not “clone and instantly RCE.” It is execution of local aliases/hooks in any tree Token Meter decides to scan (poisoned config from an install script, a copied .git, or an earlier compromise).

Where

  • token_meter/services/git_delivery.py (_subprocess_runner, _run_git)
  • token_meter/app.py (git_delivery_candidates)

The denylist also omits verbs such as merge / add (current callers do not use them; still defense in depth).

Suggested fix

Invoke git with GIT_CONFIG_GLOBAL=/dev/null, GIT_CONFIG_NOSYSTEM=1, -c core.hooksPath=/dev/null, and -c alias.<verb>= for the verb being run. Do not use repo-local aliases or hooks.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in token_meter/services/git_delivery.py at _subprocess_runner and _run_git, then trace how token_meter/app.py supplies paths through git_delivery_candidates. Ensure Git invocations ignore local and system configuration, aliases, and hooks while preserving current callers, and check the existing delivery behavior for regressions.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, python
Domain
security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.