Every case · full detail

The rest of the examples.

The highlight reel shows one card per idea. Here are the branches it folds in, in the same side-by-side format, so the examples are fully documented, not just sampled.

Seen in the wild

Start here: the tricks with documented real-world exploitation, including named campaigns, nation-state actors, and CVEs in CISA's Known Exploited Vulnerabilities catalog. The rest of the corpus follows.

Seen in the wild Filename

Newline in a filename

A newline in a name can forge an entire extra line of output: a single file that appears to be two.

git status
$ git status --short
A  notes
injected.txt

# one file, printed as two lines
git-diff-review
[WARN] path 'notes\ninjected.txt' contains a tab
       or newline byte, anomalous in a filename;
       it can forge diff-output lines.

The catch: the raw name is scanned before it prints; the newline is called out instead of forging a line.

Backdoor path: A control character in a path can redirect a checkout to an unintended location (e.g. a hooks directory), turning a committed file into code that runs on clone.

Seen in the wild: a carriage return in a submodule path redirects a clone into git's hooks (CVE-2025-48384), exploited in the wild and listed in CISA's KEV catalog. Not attributed to a named group in public reporting.

git diff master..path/newline-in-filename

File contents

More cases where the stored bytes differ from what a viewer shows.

Fails closed

Invalid UTF-8 byte

An undecodable byte (0xFF) is not valid text at all. Rather than guess at a rendering, the tool refuses.

cat
$ cat data/config.env
checksum=�� not valid utf-8

# replacement chars, or mojibake, or nothing
git-diff-review
[WARN] data/config.env suspicious Unicode (rc=2):
[ERROR] triggered a fatal error in unicode-show.
        Failing closed.
[NOTICE] set GIT_REVIEW_UNICODE_NONFATAL=1 to review anyway.

The catch: undecodable input can't be rendered safely, so review stops: fail closed, not best-effort.

Backdoor path: Undecodable bytes blind naive review tooling and can crash a viewer: cover for smuggling a payload a reviewer's editor renders as harmless mojibake.

git diff master..content/invalid-utf8
Terminal rewrite

Lone carriage return

A bare CR returns the cursor to column 0, so the text after it overwrites the text before. cat shows only the second half.

cat
$ cat data/config.env
DELETE_EVERYTHING=no

# a CR erased "DELETE_EVERYTHING=yes" in front of it
git-diff-review
[WARN] data/config.env suspicious Unicode:
    -> U+000D CARRIAGE RETURN (Cc)
--- diff (neutralized) ---
+ DELETE_EVERYTHING=yes_DELETE_EVERYTHING=no

The catch: the CR is defanged to _, so both halves show. The yes can't hide behind the no.

Backdoor path: A carriage return mid-line overwrites the visible text, so the reviewer reads LOG_LEVEL=info while the committed line ends ; echo ATTACKER_KEY >> ~/.ssh/authorized_keys.

git diff master..content/lone-cr

Paths

More filename and metadata cases, where diff tools often print raw, unchecked bytes.

Filename

Tab in a filename

A tab inside a name can forge column separation in git status or diff output, so one file reads as two.

git status
$ git status --short
A  notes	evil.txt

# the tab looks like a column break
git-diff-review
[WARN] path 'notes\tevil.txt' contains a tab or
       newline byte, anomalous in a filename;
       it can forge diff-output lines.

The catch: a filename is untrusted data too; a tab is named, not printed raw.

Backdoor path: A tab forges column breaks in git status, so a second malicious file hides inside what looks like one benign entry: an extra file slipped past review.

git diff master..path/tab-in-filename
Fails closed

.gitattributes in a non-ASCII dir

The -diff hiding trick, but the .gitattributes sits in a non-ASCII-named directory that git quotes in its output, so a naive text match would miss it.

git diff --name-only
$ git diff --name-only
"m\303\266r/.gitattributes"

# quoted (core.quotePath): a match for
# '.gitattributes' slips right past
git-diff-review
[ERROR] .gitattributes changed. It can hide
        OTHER files' contents from the diff.
        Failing closed.

The catch: the gate reads raw NUL-separated names, so the quoting can't sneak a .gitattributes past it.

Backdoor path: The same -diff hiding trick, placed in a non-ASCII directory git quotes in its output, so even reviewers grepping for '.gitattributes' miss it. The backdoored file shows no diff.

git diff master..path/gitattributes-nonascii-dir

Types & metadata

More changes with little or no content. The danger is in the metadata.

That's the full set. The two ref-name cases (a bidi override and a homoglyph of master) are on the highlights page; browse all 22 branches on GitHub.