git-arg-injection

Arguments cannot become git options

shipped

The sections below are generated from the CLI (methodology 0.3-draft, CLI 0.3.0); the same text is printed by sealmark explain git-arg-injection.

pack
git
weight
critical
scope
server (validation, or a `--` separator, before git runs)
decided by
fs-observerresponse
since
0.2-draft (methodology 0.3-draft)
config keys
checks.git-arg-injection.corpus.addchecks.git-arg-injection.corpus.removechecks.git-arg-injection.enabledchecks.git-arg-injection.severitysandbox.enabledtools.overrides

Probes

  • control a read-only git tool with benign values (HEAD, main, tracked.txt) must answer on {sandbox}/repo
  • output-option --output={sandbox}/repo/pwned-<t>.txt as the revision, branch, file list or search string

Settings and thresholds

Every check also takes checks.git-arg-injection.enabled and checks.git-arg-injection.severity; they are described once in the configuration reference.

This check has no numeric threshold.

KeyDefaultStandardMeaning
checks.git-arg-injection.corpus.add[]lockedExtra probes for git-arg-injection, validated against the pack's corpus schema. Appends across layers. Any addition makes the run CUSTOM.
checks.git-arg-injection.corpus.remove[]lockedProbe ids or exact strings to drop from the git-arg-injection corpus. Appends across layers. Any removal makes the run CUSTOM.
tools.overrides{}lockedPer-tool classifier overrides: { tool: { class, params } }. An override always wins and is printed.

How the verdict is established

  • Scoring. critical and scored: pass = 1 point, part = 0.5, fail = 0. A fail caps the pack's grade at D, whatever the other checks scored.

What to fix

Pass user input after a -- separator or as validated positional values so it can never be read as a git option; reject values that start with a dash (for example --output).

False positives

A ref or file under .git/ that carries the probe's name (a branch or tag created with a dash-prefixed name) is reported but not counted: only a file created outside .git/ is read as git honouring the option. A server that writes such a file for its own reasons would be misread; none is known.

False negatives

Only --output is observable, so options such as -c are not tested. Every string, string-list or optional (anyOf) string parameter is probed except the repository, a commit message, file content and parameters with a fixed set of values; a commit message is not an injection point and is not probed. Tools that need a control and have none can fail but cannot pass. Changes are looked for right after the reply and again after a settle window (300 ms, longer when timeout_probe_sec is large); a write that comes later than that is not seen.