OSV schema
The OSV (Open Source Vulnerability) schema, maintained by the OpenSSF in ossf/osv-schema, is a JSON interchange format that describes a vulnerability and maps it precisely to package versions or commit hashes. With this skill the agent writes and validates OSV records, publishes them as a home database, and evaluates them as a consumer to decide whether a package version or commit is affected.
Follow the workflow below step by step. Every rule here comes from a source in Sources, with the section it cites. Citations name the heading in the rendered specification (docs/schema.md), for example (§ affected[].ranges[].events). When a rule and the pinned source disagree, the source wins; when the source has a newer revision than the pin, follow the refresh steps.
Inputs (fill in, or ask before starting)
- Role: producer (a home database or converter that exports records), aggregator (re-serves other databases' records), or consumer (a scanner or tool that matches packages against records).
- Ecosystems: which package ecosystems the records cover, and whether commit-level (
GIT) data is available. - Home database prefix: the registered
idprefix you publish under, orx_for a local database not aggregated by OSV.dev. - Target version: OSV schema 1.9 (default, release 1.9.1). OSV schema 1.7 to 1.8, OSV schema 1.2 to 1.6 and OSV schema 1.0 are legacy: read them and upgrade from them, never author them. OSV schema main (unreleased) is a preview (posture: track): never emit it. See
references/versions.md. - Revision: the pinned revision in Sources, unless the user names another.
- Sources: when refreshing this skill or when a rule looks out of date, re-read every URL in Sources first, check the
ossf/osv-schemareleases andCHANGELOG.mdfor a newer release, diffdocs/schema.mdandvalidation/schema.jsononmainagainst the release tag, and update the pins.
Invariants
idandmodifiedare required, andschema_versiontoo above 1.0.0 (§ id, modified fields). Every other field is optional.idis<DB>-<ENTRYID>with a defined prefix. Use a prefix from the defined database prefix table, orx_for a local database (§ id, modified fields). The JSON Schemaprefixpattern enforces the list.- Timestamps are RFC 3339 in UTC ending in
Zformodified,publishedandwithdrawn(§ id, modified fields; § published field; § withdrawn field). Of two records with the sameid, the latermodifiedis authoritative. schema_versionis SemVer with no leadingv; a missing value means1.0.0. Readers process a newer minor or patch version by ignoring unexpected fields (§ schema_version field).- Only the JSON encoding is served, not YAML, TOML or any other transliteration (§ Format Overview).
package.ecosystemis a defined ecosystem andnameis always present with it, because the ecosystem defines how the name is read (§ affected[].package field).purlhas no@versionpart.- Every range has a
typeand at least oneintroducedevent; each event object holds exactly one ofintroduced,fixed,last_affectedorlimit; a range never mixesfixedandlast_affected(§ affected[].ranges[].type field; § affected[].ranges[].events fields, Requirements). GITranges carryrepoand full-length commit hashes (§ affected[].ranges[].repo field;validation/schema.json, "GIT ranges must use full-length commit hashes").- Top-level and per-package
severityare exclusive. If anyaffected[].severityis set, the top-levelseveritymust not be (§ affected[].severity field). - A version is affected if it is listed in
versionsor lies in any range, evaluated with theIsVulnerablealgorithm (§ affected fields; § Evaluation).database_specificnever changes the result (§ affected[].ranges[].database_specific field). aliasesonly for the same vulnerability;upstreamfor supply-chain parents;relatedfor the rest. A distribution record must not list the upstream library's CVE as an alias (§ aliases field; § upstream field; § related field).detailsis CommonMark;summaryis plain text. Display code may strip raw HTML and non-http(s)links, and databases are encouraged not to include them (§ summary, details fields).
Workflow
- Pick the version. Use OSV schema 1.9 and set
schema_versionto"1.9.1". If you are handed older records, plan the upgrade (step 8). ->references/versions.md✓ The target version is recorded, and it is not a legacy or preview line. - Fix the identity. Choose the
idfrom your registered prefix, setmodified(andpublished), and fillaliases,upstreamandrelatedby their definitions. ->references/ecosystems-and-ids.md,references/fields.md✓ Theidmatches the JSON Schema prefix pattern, and no upstream CVE sits inaliasesof a downstream record. - Describe the vulnerability. Write
summary(one line, about 120 characters at most),details,severitywith a defined type and optionalsource,referenceswith defined types, andcredits. ->references/fields.md✓ Every CVSSscoreis a vector string that matches its type's pattern;Ubuntuscores are lowercase priorities. - Describe what is affected. One
affectedentry per package, withpackage.ecosystemandname(andpurl), thenrangesand/orversions. Put commit-level data in a separate entry with nopackageand aGITrange. ->references/affected-and-ranges.md,references/ecosystems-and-ids.md✓ Each range has a validtype, anintroducedevent, single-key events, and usesfixedrather thanlast_affectedorlimitwhere a fix is known. - Validate. Check the record against
validation/schema.jsonwith any JSON Schema 2020-12 validator, then against the prose rules the schema cannot express. ->references/publishing-and-consuming.md✓ The record validates, and the Verify list below passes. - Publish (producer). Serve one JSON file per
idat a stable URL, bumpmodifiedon every change, withdraw withwithdrawnand the reason insummary, and register a prefix and ecosystem before contributing to OSV.dev. ->references/publishing-and-consuming.md✓ Every published change has a latermodified, and the prefix is in the defined table. - Consume (consumer). Match by
ecosystemandname(or purl), evaluate withIsVulnerable, ignore unknown fields, and resolve duplicates bymodified. ->references/affected-and-ranges.md,references/publishing-and-consuming.md✓last_affected,limitandintroduced: "0"are handled, andECOSYSTEMandGITranges are not compared as SemVer. - Upgrade (only when asked). Follow the upgrade section for each step from the source line to OSV schema 1.9.
->
references/versions.md✓ The upgraded record validates against the 1.9.1 schema and affects the same versions as before.
Verify before done
-
idandmodifiedare present, andschema_versionis"1.9.1"(§ schema_version field; § id, modified fields). - The record validates against
validation/schema.jsonat tagv1.9.1, which rejects unknown top-level fields (additionalProperties: false). - All timestamps are UTC and end in
Z. - Every
package.ecosystemis in the defined list, with a suffix only where the ecosystem defines one, andnamefollows that ecosystem's naming rule (§ Defined ecosystems). - Every
eventsarray has anintroduced, single-key event objects, and nofixedtogether withlast_affected(§ Requirements). -
SEMVERranges are used only for real SemVer 2.0 versions and do not overlap; other version schemes useECOSYSTEMwith an enumeratedversionslist where possible (§ affected[].ranges[].type field). -
GITranges haverepo, full 40- or 64-character hashes, and afixedevent for every cherry-picked fix commit (§ Requirements). - Top-level
severityis absent whenever anyaffected[].severityis set (§ affected[].severity field). -
aliases,upstreamandrelatedfollow their definitions (§ aliases field; § upstream field; § related field). - Nothing from the main-branch preview is emitted (for example, an
idvalidated only against unreleased rules).
Reference index
references/versions.md: every version line with its status, what changed per release, upgrade steps, and the main-branch preview. Load for steps 1 and 8.references/fields.md: every top-level field,severitytypes and sources,referencestypes,creditstypes, and the JSON Schema constraints. Load for steps 2, 3 and 5.references/affected-and-ranges.md:affected,package,versions, range types, events, special values, theIsVulnerablealgorithm and worked examples. Load for steps 4 and 7.references/ecosystems-and-ids.md: the defined ecosystems with their suffix and naming rules, the wildcard name, and the database prefixes. Load for steps 2 and 4.references/publishing-and-consuming.md: validation, publishing as a home database, contributing to OSV.dev, the OSV.dev API and data dumps, consumer rules and common mistakes. Load for steps 5 to 7.
Related skills
purlfor the Package URL inaffected[].package.purland OSV.dev purl queries:npx skills add ScaleDockHQ/scaledock-skills --skill purl.cyclonedxfor SBOMs and VEX whose components are matched against OSV records:npx skills add ScaleDockHQ/scaledock-skills --skill cyclonedx.csaffor CSAF security advisories, another advisory format:npx skills add ScaleDockHQ/scaledock-skills --skill csaf.openvexfor exploitability statements about vulnerabilities found through OSV:npx skills add ScaleDockHQ/scaledock-skills --skill openvex.
Sources
Status uses the publishing body's own maturity term. Checked is the date the source was last read.
- OSV schema specification (rendered): Released (stable), Version 1.9.1 (2026-09-24), checked 2026-10-05.
- OSV schema docs/schema.md at v1.9.1: Released, tag v1.9.1 (8e3305d), checked 2026-10-05.
- OSV JSON Schema validation/schema.json at v1.9.1: Released, tag v1.9.1, JSON Schema 2020-12, checked 2026-10-05.
- OSV JSON Schema validation/README.md: Released, tag v1.9.1, checked 2026-10-05.
- OSV schema CHANGELOG: Released, through 1.9.1, checked 2026-10-05.
- OSV schema RELEASING.md: Released, tag v1.9.1, checked 2026-10-05.
- OSV schema releases: GitHub releases, latest v1.9.1 (2026-09-24), checked 2026-10-05.
- OSV schema docs/schema.md on main: Unreleased, main at 2780d2a (2026-10-01); Draft posture: track, checked 2026-10-05.
- OSV schema docs/schema.md at v1.9.0: Released (superseded), tag v1.9.0 (2026-08-06), checked 2026-10-05.
- OSV schema docs/schema.md at v1.8.0: Released (superseded), tag v1.8.0 (2026-07-09), checked 2026-10-05.
- OSV schema docs/schema.md at v1.7.0: Released (superseded), tag v1.7.0 (2025-03-05), checked 2026-10-05.
- OSV schema docs/schema.md at v1.6.7: Released (superseded), tag v1.6.7 (2024-09-16), checked 2026-10-05.
- OSV schema docs/schema.md at 1.2.0: Released (superseded), tag 1.2.0 (2022-01-19), checked 2026-10-05.
- OSV schema docs/schema.md at 1.1.0: Tag (no release or changelog entry), tag 1.1.0 (2021-12-15), checked 2026-10-05.
- OSV schema docs/schema.md at 1.0.0: Released (superseded), tag 1.0.0 (2021-09-08), checked 2026-10-05.
- OSV.dev API documentation: Documentation, API 1.0, checked 2026-10-05.
- OSV.dev POST /v1/query: Documentation, API 1.0, checked 2026-10-05.
- OSV.dev POST /v1/querybatch: Documentation, API 1.0, checked 2026-10-05.
- OSV.dev GET /v1/vulns/{id}: Documentation, API 1.0, checked 2026-10-05.
- OSV.dev data sources and data dumps: Documentation, as published 2026-10-05, checked 2026-10-05.
- OSV.dev contributing a new data source: Documentation, as published 2026-10-05, checked 2026-10-05.
- Properties of a High Quality OSV Record: Documentation, 1.0.0, checked 2026-10-05.