GCVE Best Current Practice

GCVE BCP-05-X-06 - Patch Artifacts and Preservation

GCVE BCP-05-X-06: Patch Artifacts and Preservation

  • Version: 0.1
  • Status: Draft (for Public Review)
  • Date: 2026-12-03
  • Authors: GCVE Working Group
  • BCP Extended ID: BCP-05
  • BCP ID: BCP-05-X-06

This guide is available under CC-BY-4.0.

Copyright (C) 2026 GCVE Initiative.

Abstract

This extension lets a producer associate exact patch artifacts with a GCVE vulnerability record. A producer can attach the complete patch for offline preservation or publish its SHA-256 digest so recipients can verify a copy obtained separately. Patch artifacts can be associated with existing references, including references tagged patch, or published without an external reference.

Motivation and Scope

A patch reference can lead to a commit page, a vendor portal, or a downloadable file. The link can stop resolving, require credentials, or serve different bytes over time. An embedded copy remains available wherever that version of the record is retained. A digest identifies the expected bytes and supports verification if a copy is later obtained.

The extension supports the following use cases.

  • Preserve a patch when an upstream repository, forge, or vendor download disappears.
  • Publish a patch approved for redistribution when the source repository or full advisory is private.
  • Verify that a copy retrieved from a mirror, package archive, or offline handoff matches the publisher’s artifact.
  • Document upstream fixes, downstream backports, or separate maintenance branches in the same record.

A patch artifact is a discrete sequence of bytes that the producer associates with remediation, such as a unified diff, a patch series distributed as a single file, or a vendor patch file. The extension records artifact identity and optional availability. Product impact, fix applicability, and advisory publication status follow their respective record fields and extensions.

Terminology and Normative Language

The key words MUST, MUST NOT, SHOULD, SHOULD NOT, and MAY are used as described in IETF BCP 14 when they appear in all capitals. RFC 2119, RFC 8174

Placement

A BCP-05 entry using this optional extension MUST use the key bcp-05-x-06 within its extensions object. The extension value MUST contain the x_patchArtifacts object. In a CVE CNA container, the path is containers.cna.x_gcve[0].extensions["bcp-05-x-06"].x_patchArtifacts for the first GCVE entry. A GCVE entry carried in an ADP container or a standalone representation uses the same relative extension path. GCVE BCP-05

Patch metadata and bytes belong inside this extension. The CVE v5.2 reference object permits url, name, and tags. Producers MUST retain that shape in CVE reference arrays. CVE Record Format v5.2.0

Association With References

referenceUrls identifies sources for a patch, such as a commit page, a release note, or a vendor bulletin. When a producer associates an artifact with a reference already in the record, it MUST copy the value of the reference’s url verbatim as a JSON string. Consumers MUST use exact string equality on the parsed URL values, without URL normalization, redirect resolution, or array positions. For a CVE representation, the association is scoped to the references array of the CNA or ADP container carrying that GCVE entry. In a standalone representation, consumers can use the enclosing record’s reference list if its format defines one.

A reference MAY be associated regardless of its tags. One artifact MAY cite multiple references, and one reference MAY be cited by multiple artifacts. When a URL has no matching reference entry, consumers MUST retain its meaning as a source citation. An artifact remains valid if a source link stops resolving. A producer MAY omit referenceUrls when no URL is available or suitable for disclosure.

Data Model

The x_patchArtifacts object has one required member, patches, a non-empty array of patch objects. Each object describes one artifact. Producers MUST use each patchSha256 value at most once in the array and MAY combine multiple sources or download locations for the same bytes in one object. Array order carries no processing or application-order semantics.

Member Type Required Semantics
patchSha256 string Yes Lowercase, 64-character hexadecimal SHA-256 digest of the complete artifact bytes.
sourceCommits array of objects No Source commits associated with the artifact, when known and suitable for disclosure.
contentBase64 string No Complete artifact bytes encoded using standard RFC 4648 Base64 with required padding and no whitespace.
sizeBytes integer No Exact byte length of the artifact before Base64 encoding.
referenceUrls array of strings No Source or contextual references for the patch.
downloadUrls array of strings No Locations expected to provide the exact artifact bytes described by patchSha256.
fileName string No Suggested basename for display or manual export.
mediaType string No Media type of the artifact before Base64 encoding, such as text/plain or application/octet-stream.
description string No Human-readable description of the artifact, such as its maintenance branch or intended version line.
capturedAt string No RFC 3339 date-time when the producer obtained the exact artifact bytes, with an explicit UTC offset.
license string No SPDX license expression for the artifact, when known.

If present, referenceUrls and downloadUrls MUST be non-empty and contain unique strings. Each referenceUrls value MUST be an absolute URI. Each downloadUrls value MUST be an absolute HTTP(S) URL with no user information. Producers SHOULD use HTTPS for download locations and supply a media type for embedded content. A fileName MUST be a non-empty basename other than . or .. and MUST omit path separators and control characters. A sizeBytes value MUST be positive. RFC 3986, RFC 3339, SPDX license expressions

Source Commits

One patch object can cite multiple source commits. This covers byte-identical artifacts associated with distinct commits, such as a cherry-pick, as well as a patch series distributed as a single artifact. The array order carries no application-order semantics.

Member Type Required Semantics
commitId string Yes Full, canonical identifier of the commit in its source-control system.
repositoryUrl string Conditional Absolute URI identifying the source repository. Required when the commit ID is scoped to a repository.

If present, sourceCommits MUST be non-empty. Each pair of commitId and repositoryUrl MUST be unique within the array, using exact string equality and treating omitted repository URLs as equal to one another. A Git commitId MUST be a lowercase hexadecimal object ID of 40 characters for SHA-1 or 64 characters for SHA-256. Producers MAY include a commit page in the patch object’s referenceUrls. Git hash function transition

Processing and Validation

  1. Producers MUST compute patchSha256 over the complete artifact bytes. If embedding the artifact, they MUST encode those same bytes in contentBase64. A Git commit identifier, a shortened hash, and a digest over the Base64 text are invalid values for patchSha256.
  2. Consumers validating embedded content MUST decode contentBase64 using canonical RFC 4648 Base64, reject empty output, and check the digest and sizeBytes when supplied. Verification MUST preserve the bytes exactly, including character encoding, line endings, and trailing newlines. RFC 4648
  3. A digest-only entry is valid without a download URL. If a consumer obtains a copy, it MUST compare the artifact digest and the declared size, if present, before presenting that copy as verified against the record. For HTTP responses, hash the representation bytes after removing transfer and content codings, before media-type processing or archive extraction.
  4. Conformance checks for this extension MUST work without fetching a URL. An unavailable source or mirror leaves the recorded digest and any valid embedded bytes intact. Consumers MUST report a digest or size mismatch as an artifact verification failure. They SHOULD retain the containing record and continue processing its other artifacts.
  5. Consumers that cannot interpret the extension SHOULD preserve it during lossless forwarding. Consumers MAY ignore unknown members. A record update that replaces the underlying bytes MUST publish the digest of the replacement and update its source commits, inline content, size, and download locations as applicable.

Identical digests support byte-level deduplication. Equivalent changes can have different digests when exported with different headers, context, line endings, or archive formats.

Publication, Privacy, and Security Considerations

Producers MUST have permission to redistribute any bytes they embed. Before public release, they MUST review the artifact and its metadata for embargoed material, credentials, personal information, and restricted source locations. This review also applies to digests when they could confirm the identity of restricted material. The document license applies to this specification. Any embedded patch carries its own applicable terms.

A producer authorized to publish a patch while the detailed advisory remains restricted can publish a separately scoped BCP-05 remediation record with a relationship to an identifier suitable for disclosure. Its publication state applies to that public record. The restricted advisory retains its own distribution controls. The same disclosure constraints apply to records issued without the X-05 extension. GCVE BCP-02, GCVE BCP-05-X-05

Consumers MUST treat patch bytes as untrusted data and MUST NOT apply or execute them automatically on ingestion. Consumers SHOULD enforce size limits when decoding or retrieving artifacts, safely render text, and sanitize filenames before export. Consumers that fetch URLs SHOULD validate destinations and redirects, including blocking access to internal addresses and services for untrusted records. A successful digest check establishes agreement with the bytes identified by the record. Publishers and consumers use their existing trust mechanisms to establish provenance and applicability.

Relationship to Other GCVE BCPs

  • BCP-05 defines the containing record, semantic record types, and relationships. A patch can accompany an advisory or be published in a linked remediation record. GCVE BCP-05
  • BCP-05-X-02 records the provenance of metadata generated from a patch. When both extensions describe the same input bytes, their patchSha256 values MUST agree. X-06 also covers independently supplied remediation patches and backports. GCVE BCP-05-X-02
  • BCP-05-X-03 can record when a fix became available. X-06 capturedAt records when the producer obtained an artifact. GCVE BCP-05-X-03
  • BCP-05-X-05 can describe the publication and visibility of the containing advisory or remediation record. GCVE BCP-05-X-05

Examples

The examples use fictional products, references, and patches.

Advisory With Two Patch References

The first artifact preserves the patch and records two commits that share those exact bytes, the upstream commit and a cherry-pick on a maintenance branch. It also retains the original, now-broken URL. The second artifact represents a backport with different patch bytes and includes an untagged commit reference and a separate download location.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "cveMetadata": {
    "cveId": "CVE-1900-0006",
    "assignerOrgId": "a31e1310-5457-4e16-9db6-c83d4b68f7c4",
    "state": "PUBLISHED"
  },
  "containers": {
    "cna": {
      "providerMetadata": {
        "orgId": "a31e1310-5457-4e16-9db6-c83d4b68f7c4"
      },
      "descriptions": [
        {
          "lang": "en",
          "value": "The example configuration in Example Toolkit used a legacy default."
        }
      ],
      "affected": [
        {
          "vendor": "Example",
          "product": "Example Toolkit",
          "versions": [
            {
              "version": "2.0.0",
              "status": "affected"
            }
          ]
        }
      ],
      "references": [
        {
          "url": "https://example.com/toolkit/patches/main.patch",
          "tags": ["patch", "broken-link"]
        },
        {
          "url": "https://example.com/toolkit-1.x/commits/56e2b7ff031ba7e45d1c2a190bbd8c33e4f0977534ea2138c7610bfea83d64c2"
        }
      ],
      "x_gcve": [
        {
          "vulnId": "GCVE-65535-2026-0600",
          "recordType": "advisory",
          "extensions": {
            "bcp-05-x-06": {
              "x_patchArtifacts": {
                "patches": [
                  {
                    "patchSha256": "fe2c03d15d6d8df9f7853710e65a7232c1fe6e7ba44e45bdd1aa75d4b9da641f",
                    "sourceCommits": [
                      {
                        "commitId": "7b4c10a29e653f18d0426bd569ea370c4a8f52e3",
                        "repositoryUrl": "https://example.com/toolkit"
                      },
                      {
                        "commitId": "c723a554e1609c5e0e4a5e79c8df8db3df4d0ca3",
                        "repositoryUrl": "https://example.com/toolkit"
                      }
                    ],
                    "contentBase64": "LS0tIGEvY29uZmlnL2V4YW1wbGUuY29uZgorKysgYi9jb25maWcvZXhhbXBsZS5jb25mCkBAIC0xICsxIEBACi1tb2RlPWxlZ2FjeQorbW9kZT1zdGFuZGFyZAo=",
                    "sizeBytes": 92,
                    "referenceUrls": ["https://example.com/toolkit/patches/main.patch"],
                    "fileName": "main.patch",
                    "mediaType": "text/plain",
                    "description": "Upstream patch for the 2.x branch.",
                    "capturedAt": "2026-12-01T10:00:00Z",
                    "license": "MIT"
                  },
                  {
                    "patchSha256": "50c4ee84bf3c23831f77ee211da8f3c29b656a4c114a4e7b484863b53d152abd",
                    "sourceCommits": [
                      {
                        "commitId": "56e2b7ff031ba7e45d1c2a190bbd8c33e4f0977534ea2138c7610bfea83d64c2",
                        "repositoryUrl": "https://example.com/toolkit-1.x"
                      }
                    ],
                    "sizeBytes": 90,
                    "referenceUrls": ["https://example.com/toolkit-1.x/commits/56e2b7ff031ba7e45d1c2a190bbd8c33e4f0977534ea2138c7610bfea83d64c2"],
                    "downloadUrls": ["https://example.net/archive/toolkit-1.x.patch"],
                    "description": "Backport for the 1.x maintenance branch."
                  }
                ]
              }
            }
          }
        }
      ]
    }
  }
}

Standalone Remediation Record With No Patch URL

This GCVE record publishes an approved patch whose upstream repository is private. The relationship identifies the associated vulnerability independently of the remediation record’s identifier.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{
  "x_gcve": [
    {
      "vulnId": "GCVE-65535-2026-0601",
      "recordType": "remediation",
      "relationships": [
        {
          "destId": "GCVE-65535-2026-0600",
          "type": "related"
        }
      ],
      "extensions": {
        "bcp-05-x-06": {
          "x_patchArtifacts": {
            "patches": [
              {
                "patchSha256": "ae74b6c528a8e1524856f0a7747ec2539f02e22fc968a9247df29d415d9fc811",
                "contentBase64": "LS0tIGEvY29uZmlnL2xvY2FsLmNvbmYKKysrIGIvY29uZmlnL2xvY2FsLmNvbmYKQEAgLTEgKzEgQEAKLW1vZGU9bGVnYWN5Cittb2RlPXN0YW5kYXJkCg==",
                "fileName": "local.patch",
                "mediaType": "text/plain",
                "description": "Redistributable patch for the maintained deployment."
              }
            ]
          }
        }
      }
    }
  ]
}