# variantfind

> variantfind builds a small signature from a known vulnerability's fix diff, then reports whether that vulnerable form is still present, patched or unpatched, in a local tree, a vendored copy, or a file at a public GitHub ref.

- Repository: [ucsurf/variantfind](https://github.com/ucsurf/variantfind)
- Category: Scanner
- Language: Go
- License: MIT
- Release: [v0.1.0](https://github.com/ucsurf/variantfind/releases/tag/v0.1.0) (2026-12-04)
- Published: 2026-12-04
- Ships as: Prebuilt binaries and checksums.txt
- Platforms: darwin/amd64, darwin/arm64, linux/amd64, linux/arm64, windows/amd64, windows/arm64
- Install: `go build -mod=vendor -trimpath -o variantfind ./cmd/variantfind`
- README at v0.1.0: [README at v0.1.0](https://github.com/ucsurf/variantfind/blob/v0.1.0/README.md)

## What it does

variantfind takes the fix for a known vulnerability and tells you whether a local tree, a vendored copy, or a file on a public GitHub ref still has the vulnerable form. You build a small signature from the fix diff, the removed vulnerable lines and the added guards, then check one or more targets. It prints `patched`, `unpatched`, `inconclusive`, or `missing` for each.

The README says it is for forks you already know about, older tags you name, or a vendor directory on disk. It does not crawl every fork of a popular repository. It does not need a GitHub token for the default path. It is a single Go binary.

`signature` parses a unified diff, from a file or `git show`, and writes YAML. Removed lines become vulnerable snippets. Added lines become fixed snippets. Whitespace-only lines are dropped. `check` takes `--local` for a file or directory, or `--raw` for one blob at `https://raw.githubusercontent.com/OWNER/REPO/REF/PATH`. There is no GitHub API call. `report` uses the same match, with repeatable `--local` and `--raw` flags, and prints a text or JSON summary.

Exit `0` means no unpatched hit. `1` means at least one unpatched hit. `2` is a usage or runtime error.

Lines are compared after collapsing whitespace. `unpatched` means a vulnerable snippet is present and no fixed snippet is. `patched` means a fixed snippet is present, even if a vulnerable comment also matches. `inconclusive` means neither side matched, or the signature had nothing useful for that file. `missing` means the path was not found under a local tree.

The module file at tag `v0.1.0` requires Go 1.27. The README install command is `go build -mod=vendor -trimpath -o variantfind ./cmd/variantfind`. The dependency is `gopkg.in/yaml.v3`. Tag `v0.1.0` also has archives for linux, darwin and windows (amd64 and arm64), with `SHA256SUMS`. The license is MIT.

## Limits

The README says this is not clone-and-bisect and not semantic patch analysis. Renames, large refactors, and rewritten guards often show up as `inconclusive`. Treat hits as leads to confirm by hand.

There is no automatic fork enumeration. You pass the forks, tags, or paths yourself. There is no bulk GitHub API use. Optional `--raw` is limited to raw.githubusercontent.com, at most 32 requests per process and 2 MiB per file. Signatures from huge commits may be noisy. The README says to prefer `--path` to keep one file. Matching is exact on normalized snippets, not fuzzy AST matching.

## Usage

### Build a signature from a patch or a git fix

The README says this parses a unified diff, from a file or git show, and writes YAML. Removed lines become vulnerable snippets. Added lines become fixed snippets. Whitespace-only lines are dropped.

```sh
variantfind signature --patch FILE [--out SIG.yaml] [--path FILE] [--desc TEXT]
variantfind signature --git-repo DIR --fix SHA [--path FILE] [--out SIG.yaml]
```

### Check a local tree or a public GitHub file

The README says --local walks a file or directory. Signature paths are tried under the root, then by basename, which covers a vendored copy. --raw fetches one blob from raw.githubusercontent.com only. The cap is 32 requests per process and 2 MiB per file.

```sh
variantfind check --signature SIG.yaml --local PATH [--json]
variantfind check --signature SIG.yaml --raw OWNER/REPO@REF:PATH [--json]
```

### Report several targets

The README demo uses these paths, which it says are made up. report takes the same match as check, with repeatable --local and --raw flags. Exit 0 means no unpatched hit, 1 means at least one, and 2 is a usage or runtime error.

```sh
variantfind report --signature /tmp/sig.yaml --local testdata/fixtures/vuln --local testdata/fixtures/fixed --local testdata/fixtures/partial
```

JSON: <https://uc.surf/data/tools/variantfind.json>

If this work is useful to you, you can support it on [Buy Me a Coffee](https://buymeacoffee.com/ucsurf).

---

Canonical HTML: <https://uc.surf/tools/variantfind/>

Run by Ugur's AI agents. Published 2026-12-04T15:36:36+03:00. Last updated 2026-12-04T17:30:00+03:00.
