Skip to content

fix(id): bind export blob refs to envelope content citations in verify_import - #13356

Merged
dezren39 merged 1 commit into
mainfrom
lane-wq-13289
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
lane-wq-13289

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

What

verify_import (§6.2 step 3) now binds each export object's blob_refs to the content citations of its own verified envelope, instead of trusting the caller-supplied references:

  • Carried blobs are hash-verified and indexed by citation identity (BLAKE3 of the bytes — the name an envelope cites) before any object is checked.
  • For each object, the citations are read from the decoded, signature-verified envelope header, resolved against the carried blobs by content, and the declared blob_refs must name exactly that resolved set.
  • A decoy blob, an extra reference, or an omitted citation is refused with a new typed error, ExportError::BlobCitationMismatch; a citation no carried blob resolves is refused with the existing MissingBlob. All refusals happen before ingest writes anything.

Before this change, a valid signed document.put envelope citing content A could be paired with unrelated bytes B (with blob_refs naming B's SHA-256) and pass verification — blob_refs is covered by neither the envelope signature nor the manifest's objects_digest — after which ingest stored B and left A unavailable.

Verification

  • Failing-first: the three new regression tests (decoy_blob_is_refused, cited_blob_missing_is_refused, extra_blob_reference_is_refused) all failed against pre-change main and pass with the fix.
  • cargo test --lib hosted_ in pkgs/id (laptop, nix develop): 64 passed / 0 failed — including the honest hosted-worker fixture (produced_sets_fixture_verifies), the export/import round-trip, and the ingest round-trip.
  • The changed file is rustfmt-clean for its own hunks (the crate carries pre-existing fmt drift elsewhere on main, untouched here).

Fixes #13289

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-23T14:10:54Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": null,
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": null,
    "auth_subject": "archer",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Prove it works
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…y_import

verify_import trusted each object's caller-supplied blob_refs: it
checked the named blobs' SHA-256 hashes but never proved the named
bytes produce the content the object's signed envelope cites.
blob_refs is covered by neither the envelope signature nor the
manifest objects_digest, so a valid signed document.put envelope
paired with a decoy blob verified cleanly and ingest stored the
decoy while the cited content stayed unavailable.

Step 3 now indexes carried blobs by citation identity (BLAKE3 of
the bytes) and requires each object's declared references to name
exactly the blobs its decoded envelope citations resolve to: a
decoy or extra reference is a new typed refusal
(BlobCitationMismatch), and a citation no carried blob resolves
is MissingBlob. Regression tests cover the decoy, the missing
cited blob, and the extra reference; the honest hosted-worker
fixture and round-trip suites stay green.
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 54 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7bb29b63-706b-4566-b449-6c14e50b3513
Commits

Reviewing files that changed from the base of the PR and between 389be6a and e7888eb.

Files selected for processing: 1

  • pkgs/id/src/hosted_export.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T14:12:32.880510Z e7888eb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39
dezren39 merged commit c83e441 into main Nov 23, 2026
2 checks passed
@dezren39
dezren39 deleted the lane-wq-13289 branch November 23, 2026 14: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.

id: verify export blob refs against each envelope's actual content citations

1 participant