Short answer: An OSV range of type GIT describes affected code by commit hash, not version number. introduced and fixed are full 40-character hashes in the repository named by repo, and “greater than” means “descends from” in the commit graph. A fixed commit clears only its own descendants, so a fix cherry-picked onto a release branch must be listed as a second fixed event or that branch stays flagged. A limit event does the opposite job: it shrinks the range to the ancestors of one commit, which drops other branches and can hide real exposure. In three large OSV datasets we checked, nobody uses limit.
This is the commit-graph companion to our OSV schema ranges guide, which covers ECOSYSTEM and SEMVER ranges and deliberately refuses GIT. If you work from CVE records rather than OSV, the equivalent is versionType: git, which we touched on in the CVE affected versions guide and the Linux kernel CVE ranges article.
When you meet a GIT range
You need GIT ranges when there is no package version to compare: vendored C/C++ libraries, git submodules, code built from a commit, or fuzzing findings that predate any release. OSV.dev’s own blog puts the problem plainly: “C/C++ does not have a centralized package manager like npm or pyPI,” and “Software projects typically pull in C/C++ by submodules or vendoring.”
The spec (OSV schema 1.9.3, dated 30 November 2026) defines the type like this:
GIT: The versionsintroducedandfixedare full-length Git commit hashes. The repository’s commit graph is needed to evaluate whether a given version is in the range. The relationu < vis true when commituis a (perhaps distant) parent of commitv.
Two consequences follow:
repois required for GIT ranges, and it must be usable as an argument togit clone.- You cannot evaluate a GIT range from the record alone. The spec says so directly: “
GITrange inclusion queries cannot be answered without access to a copy of the underlying Git repository.” That is why it still asks for an enumeratedversionslist (tags) alongside GIT ranges.
The four events, read as graph questions
| Event | Value in a GIT range | Question you ask the graph |
|---|---|---|
introduced | Commit hash, or "0" | Is this commit an ancestor of (or equal to) mine? "0" means “from the start of history”. |
fixed | Commit hash | Is this fix commit an ancestor of (or equal to) mine? If yes, I am fixed. |
last_affected | Commit hash | Allowed by the spec, but cannot share an events array with fixed. Rare in GIT data. |
limit | Commit hash, or "*" | Is my commit a strict ancestor of a limit commit? If no limit exists, an implicit "*" (infinity) applies. |
The spec allows only one key per event object, and requires at least one introduced.
fixed versus limit: a tested example
The spec explains the trade-off in one paragraph:
eventsarrays withfixedevents must include all other cherrypicked fix commits in all branches as separatefixedevents to avoid false positive matches in other branches. Conversely,limitevents restrict the set of vulnerable commits to those reachable from thelimit, which may result in false negatives. Where possible, it’s strongly recommended to usefixedoverlimit.
To see it, we built a toy repository: main runs X - A - B - FIX - M, and release/1.x branches at A with R1, R2, then R3, a git cherry-pick -x of FIX.
#!/bin/sh
# Toy repo: main X-A-B-FIX-M; release/1.x branched at A with R1, R2, then cherry-picked fix R3.
set -e
rm -rf toy && git init -q -b main toy && cd toy
git config user.email [email protected] && git config user.name t
c(){ echo "$1" >> log && git add log && git commit -qm "$1" && git tag "$1"; }
c X; c A; git checkout -qb release/1.x; c R1; c R2; git checkout -q main; c B
echo fix > fix && git add fix && git commit -qm FIX && git tag FIX; c M
git checkout -q release/1.x && git cherry-pick -x FIX >/dev/null && git tag R3
The evaluator below uses git merge-base --is-ancestor for every comparison. It is illustrative: it treats a commit as affected when it descends from any introduced commit and from no fixed commit, which is correct for single-introduced ranges like these but not for ranges that re-introduce a bug after a fix. It is not OSV.dev’s implementation. For readability the demo range files use tag names; real records use full hashes, and the script resolves both.
#!/usr/bin/env python3
"""Evaluate an OSV GIT range against commits of a local clone. Illustrative."""
import subprocess, sys, json
def is_anc(repo, a, b):
"""True if commit a is an ancestor of (or equal to) commit b."""
return subprocess.run(["git", "-C", repo, "merge-base", "--is-ancestor", a, b]).returncode == 0
def resolve(repo, ref):
return subprocess.check_output(["git", "-C", repo, "rev-parse", ref], text=True).strip()
def affected(repo, rng, commit):
# Resolve every event to a full hash ("0" and "*" are OSV special values).
ev = [{k: (v if v in ("0", "*") else resolve(repo, v)) for k, v in e.items()} for e in rng["events"]]
limits = [e["limit"] for e in ev if "limit" in e and e["limit"] != "*"]
if limits and not any(is_anc(repo, commit, l) and commit != l for l in limits):
return False
intro = [e["introduced"] for e in ev if "introduced" in e]
fixed = [e["fixed"] for e in ev if "fixed" in e]
if not any(i == "0" or is_anc(repo, i, commit) for i in intro):
return False
return not any(is_anc(repo, f, commit) for f in fixed)
if __name__ == "__main__":
repo, rng_file, *commits = sys.argv[1:]
rng = json.load(open(rng_file))
for c in commits:
print(c, "AFFECTED" if affected(repo, rng, resolve(repo, c)) else "not affected")
We ran it with Python 3.13 and git 2.43 against three ranges (python3 osv_git_eval.py toy r1.json X A B FIX M R1 R2 R3):
| Commit | r1: introduced X, fixed FIX | r2: + fixed R3 | r3: introduced X, limit FIX |
|---|---|---|---|
| X, A, B | affected | affected | affected |
| FIX, M | not affected | not affected | not affected |
| R1, R2 | affected | affected | not affected |
| R3 (has the cherry-picked fix) | affected | not affected | not affected |
- r1 flags R3 even though it contains the fix: a false positive, because the cherry-pick has its own hash.
- r2 adds the cherry-pick as a second
fixedevent and gets every commit right. - r3 returns X, A and B, matching the spec’s description of
limitas “equivalent togit rev-list X..Y(but includingXand excludingY)”. It also clears R1 and R2, which are still vulnerable: a false negative.
If you consume GIT ranges, prefer a false positive you can suppress with a VEX not_affected statement over a false negative nobody sees.
What real OSV data uses
We counted GIT ranges in three public OSV sources (Python 3.13, PyYAML 6.0.3):
| Source (commit) | Records | Records with GIT ranges | GIT ranges | Ranges with >1 fixed | Ranges with no fixed | limit events |
|---|---|---|---|---|---|---|
pypa/advisory-database (6c98d1c, 2 Dec 2026) | 7,943 | 1,551 | 1,558 | 174 | 0 | 0 |
google/oss-fuzz-vulns (f120110, 2 Dec 2026) | 4,128 | 4,108 | 4,108 | 581 | 265 | 0 |
github/advisory-database reviewed (85ddf6c, 3 Dec 2026) | 38,222 | 0 | 0 | n/a | n/a | 0 |
What the counts show:
- Nobody uses
limit. Zero events across all three. Support it in a consumer, but expect to see it rarely. - PyPA pairs GIT with ECOSYSTEM in the same entry. All 1,551 PyPA records with a GIT range also carry an
ECOSYSTEMrange, inside the sameaffectedobject as the PyPI package. 1,555 of the 1,558 ranges start atintroduced: "0". Example: PYSEC-2017-3 (ansible, CVE-2015-6240) has a GIT range with twofixedcommits plus an ECOSYSTEM range and 45 enumerated versions. Spec 1.9.3 recommends a different layout, a separateaffectedentry with nopackagefor Git details, so expect both shapes. - OSS-Fuzz is GIT-first. 4,108 of 4,128 records use GIT ranges, almost all (4,097) under the
OSS-Fuzzecosystem. The 265 ranges without afixedevent are open-ended: per the spec’s implicitlimit: "*", everything descending fromintroducedis affected. Only 1,645 of the source files enumerateversions; the spec notes OSV.dev can populate that list from tags during ingestion. - GitHub-reviewed advisories never use GIT ranges, so a Dependabot-style pipeline built on GHSA data never needs this code path.
How to match vendored code
- Find the commit. For a submodule,
git submodule statusgives it. For a vendored copy with no history, OSV.dev’s experimentaldetermineversionAPI, described in its July 2023 blog post, estimates the likely upstream version of a local C/C++ library. - Ask OSV.dev, or evaluate locally.
POST /v1/queryaccepts{"commit": "<hash>"}; the docs say that ifcommitis specified,versionshould not be set, and the package is optional. To evaluate locally, clone therepoand use ancestry checks as above. - Check every
fixedevent, not just the first. One per branch is normal. - Do not string-compare hashes. Hashes have no order. Only the graph does.
- Feed the result into the same triage as everything else. A GIT-matched record still needs a CVE alias before KEV or EPSS can help; see the vulnerability prioritization workflow.
Common mistakes
- Treating
fixedas “everything after this date”. It clears only descendants of that commit. A branch cut before the fix stays affected unless its own cherry-pick is listed. - Shallow clones.
git clone --depth 1lacks the history needed for ancestry checks;merge-base --is-ancestorwill fail or mislead. Fetch enough history to contain theintroducedcommit. - Abbreviated hashes. The spec says full-length hashes. Resolve short ones before comparing, as the script does.
- Mixing tag versions with ecosystem versions. The spec warns that
versionsunder a GIT range “typically represent Git tags and cannot be relied upon to conform to any particular package manager’s syntax”.
Limits of this article
- The evaluator is a simplified illustration and mishandles ranges that re-introduce a bug after a fix. Use OSV.dev or a maintained scanner in production.
- Data counts are from repository source files at the commits shown, not from OSV.dev’s enriched exports, which may add
versions. We could not download OSV.dev’s bulk exports from our environment. - We did not test OSV-Scanner’s GIT handling or the
determineversionAPI.
Sources and verification
| Important claim | Source | Status |
|---|---|---|
GIT type definition, u < v relation, repo required, versions still required, event rules, fixed vs limit trade-off, limit example semantics | OSV schema 1.9.3, docs/schema.md | Verified (quoted) |
Separate Git entries without package recommended | Same, “Separating Git and Strict Ecosystems” | Verified (quoted) |
commit field in POST /v1/query; version must not be set; package optional | OSV.dev API: POST /v1/query | Verified (quoted) |
C/C++ has no central package manager; determineversion is experimental | OSV.dev blog, 20 July 2023 | Verified (quoted) |
| Toy repository results for r1, r2, r3 | Script run 3 December 2026, Python 3.13, git 2.43 | Verified (run) |
| All counts in the data table | Script run 3 December 2026 on the commits shown | Verified (computed) |
Frequently asked questions
What is a GIT range in the OSV schema?
It is an affected range whose type is GIT. Its introduced and fixed events are full-length commit hashes in the repository named by the required repo field. A commit is in range if it descends from an introduced commit and does not descend from a fixed commit.
What is the difference between fixed and limit in an OSV GIT range?
fixed clears every commit that descends from the fix commit, on any branch. limit keeps only commits that are ancestors of the limit commit, which drops other branches entirely. Missing cherry-picks under fixed cause false positives; limit can cause false negatives, so the spec recommends fixed.
Can I evaluate an OSV GIT range without cloning the repository?
Not reliably. The spec says GIT range inclusion queries cannot be answered without a copy of the Git repository, which is why it also asks for an enumerated versions list. OSV.dev can answer a commit query for you with the commit field of POST /v1/query.
Why does a single OSV record list several fixed commits?
Because the fix landed on more than one branch. Each cherry-pick has its own commit hash, and the spec says events arrays with fixed events must include all cherry-picked fix commits in all branches to avoid false positives.
OsvOsv SchemaGitVulnerability ManagementOss-FuzzPypaSbomC/C++
