Skip to content

feat(spec)!: let a sidecar outrank an unreadable footer, separate attestation_status - #74

Merged
gregogalante merged 1 commit into
mainfrom
feat/corpus-8.0.0
Oct 5, 2026
Merged

gregogalante merged 1 commit into
mainfrom
feat/corpus-8.0.0

Conversation

@gregogalante

Copy link
Copy Markdown
Member

Two owner decisions (5 October 2026). Corpus 7.0.0 → 8.0.0, major: 25 vectors re-signed and vector 72 changes verdict.

A. A sidecar that does better than an unreadable footer (§3.1)

Before: if the last 16 bytes started with VCAP and the footer could not be used, that footer decided the verdict no matter what sidecar was present:

  • CRC fails → corrupted proof
  • major ≠ 1 → unsupported format version
  • size describes no trailer → step 4 over the whole file, so tampered

So anyone could append such a footer to a trailer-stripped genuine file and make it read broken next to its genuine sidecar. #72 left this open.

Verifier algorithm

  1. Trigger: len(F) ≥ 16, the last 16 bytes start with "VCAP", they are not a valid footer with a matching CRC, and a sidecar is present.
  2. Compute V0, the verdict as before (steps 1–5 unchanged).
  3. Let n = payload_len (uint32 BE at len(F) − 8, read at its v1 position whatever the major). Let T = 8 + n + 16, summed without overflow.
  4. If T ≤ len(F) and F[len(F)−T : +4] == T (uint32 BE) and F[len(F)−T+4 : +4] == "free", then F' = F[0 : len(F) − T]. Otherwise F' = F[0 : len(F) − 16].
  5. Judge the sidecar over F' the way step 4 judges a sidecar: canonical bytes = all of F' (§4.1 step 2). Nothing further is stripped, even if F' ends in another trailer. The result is V1, with labels trailer unreadable (+ manifest copy differs if the active manifest of F' differs from the sidecar), and proof_source: sidecar.
  6. Rank outcomes: authentic 3 > verified clip 2 > frames not compared 1 > everything else 0. Return V1 if rank(V1) > rank(V0), else V0.

Why this span:

  • It is safe. Authentic / verified clip still need media.hash or segment hashes to match what remains, so a declared span cannot upgrade forged bytes. A wrong span only costs the sidecar its outcome.
  • Nothing a player shows is removed. The free box header is required, so the removed bytes are either a box every reader skips or 16 bytes that are not a box. Vector 191 pins this.
  • There is exactly one candidate, so all implementations agree.

Nested behaviour is unchanged: one trailer removed, no recursion (vector 193). A C2PA store is not a sidecar here (126 unchanged). Existing labels are unchanged.

B. attestation_status domain separator (§6.2)

"vcap/1.0/attestation-status"    27 B ASCII, no NUL, no length prefix
                                 76 63 61 70 2f 31 2e 30 2f 61 74 74 65 73 74 61 74 69 6f 6e 2d 73 74 61 74 75 73
‖ core_hash                      32 B raw
‖ JCS(entries)                   UTF-8
‖ uint64 BE fetched_at           8 B

Same style as vcap/1.0/sth, /status, /integrity, /location, /seg. Reference: attestationStatusMessage (tools/src/registry.ts). Also updated: the §6.2 table, the inconsistency note, the schema sig description, and the threat model (§5.3 Cross-message signature).

Vectors

# Case Expected
72 CRC-broken trailer, intact sidecar (moved) authentic, trailer unreadable, source sidecar (was corrupted proof)
188 stripped genuine JPEG + foreign trailer with broken CRC + genuine sidecar authentic, trailer unreadable
189 89's MP4 clip + foreign trailer with broken CRC + 166's sidecar verified clip [1,2], trailer unreadable
190 genuine JPEG + major-2 trailer + sidecar authentic, trailer unreadable
191 07's 16 fake bytes (span has no box header) + sidecar authentic, trailer unreadable (only 16 B stripped)
192 edited pixels, CRC broken, 01's sidecar (tie) corrupted proof
193 sealed 01 + CRC-broken trailer after it + sidecar (tie, no peeling) corrupted proof
06, 07, 08, 115, 118, 126 broken footer, no sidecar unchanged
44, 45, 49–54, 96–102, 106, 107, 109, 148, 149, 152, 154, 155, 157, 164 re-signed attestation_status unchanged

A verifier that predates 8.0.0, measured with the 7.0.0 reference verifier:

  • Every snapshot reads chain revocation not checked: 44/96/97/164 go red → amber, 100 goes green → amber.
  • 72/188/189 read corrupted, 190 unsupported, 191 tampered.

Docs

Updated: CHANGELOG (breaking, includes the pre-8.0.0 behaviour), §3.1/§4.1/§8/§11, the threat model (the open item is closed), the c2pa-interop table, vectors README, CONFORMANCE, VERSION, MANIFEST and the conformance report.

Gates (local, Node 22)

All passed:

  • typecheck
  • 286 tests
  • validate
  • manifest:check
  • conformance:check (193/193)
  • generate:edge-cases
  • npm run generate twice: no diff on the second run

🤖 Generated with Claude Code

…estation_status

§3.1: when the last 16 bytes carry the VCAP magic but are no usable footer
(CRC fails, major != 1, size describes no trailer) and a sidecar is present,
the sidecar is also judged over the file without the unreadable trailer: the
declared free box when it fits and its header matches, else the 16-byte
footer. It decides only when its outcome ranks strictly higher, with the new
label "trailer unreadable" and proof_source sidecar.

§6.2: attestation_status is signed over
"vcap/1.0/attestation-status" || core_hash || JCS(entries) || uint64 BE
fetched_at, closing the known inconsistency.

Corpus 7.0.0 -> 8.0.0: 25 attestation_status vectors re-signed (verdicts
unchanged), vector 72 moves to authentic, vectors 188-193 added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gregogalante
gregogalante merged commit fca3108 into main Oct 5, 2026
2 checks passed
@gregogalante
gregogalante deleted the feat/corpus-8.0.0 branch October 5, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant