Skip to content

security(agent): ripr agent receipt and verify accept fabricated input — no head binding, no signature, no re-execution #1941

Closed

Description

@EffortlessSteven

Problem

Three compounding trust gaps in the repair receipt loop:

  1. ripr agent verify (commands.rs:210-225) does NOT re-run any test. It reads two JSON snapshot files and computes static movement. No schema_version, sha256, or git binding is checked on inputs.

  2. ripr agent receipt (commands.rs:227-274) accepts any hand-authored agent-verify.json. Provenance carries sha256s but no commit binding, no signature. A fixer can fabricate agent-verify.json with any movement they like.

  3. ripr receipt write (app/receipt.rs) — current_head is optional and only format-validated (40 hex). Never compared to git rev-parse HEAD. A receipt can be stamped with any SHA.

Impact

A malicious or compromised agent can fabricate a receipt that looks like valid repair evidence. The advisory status and safe_to_merge=false in the output provide some mitigation, but downstream consumers that treat the receipt as proof of testing are deceived.

Fix

  1. ripr agent verify should validate that snapshots were produced by ripr (check schema_version, check provenance head_sha against git rev-parse HEAD).
  2. ripr receipt write should bind current_head to the actual HEAD (resolve via git rev-parse, not just format-check).
  3. Consider a content-hash commitment: the receipt should hash the actual analysis artifacts, not just accept whatever the caller provides.

Evidence

  • commands.rs:210-225 — verify reads JSON files, no re-execution
  • commands.rs:227-274 — receipt accepts any verify-json
  • app/receipt.rs:38,263 — current_head optional, format-check only

Activity

  1. coderabbitai commented on Jul 19, 2026

    @coderabbitai
    🔗 Related PRs

    #1670 - perf(review-comments): emit bounded phase receipts [merged]
    #1714 - audit(goals): add fail-closed authority audit framework [merged]
    #1827 - feat(receipt): add current_head to receipt JSON output [merged]
    #1858 - fix(lsp): preserve diagnostic budget evidence [merged]
    #1861 - feat(lsp): define versioned agent protocol contract [open]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. added
    status/needs-work
    on Jul 19, 2026
  3. EffortlessSteven commented on Jul 19, 2026

    @EffortlessSteven
    MemberAuthor

    Receipt/verification trust slices

    The sequence is provenance → vocabulary/CLI contract → explicit execution. Static-only receipts remain useful but must remain visibly lower assurance.

  4. EffortlessSteven commented on Jul 19, 2026

    @EffortlessSteven
    MemberAuthor

    Identity boundary clarification

    The receipt fix must not recreate an exact-head merge doctrine. #1977–#1979 remain the implementation sequence for artifact provenance, assurance vocabulary, and explicit command execution. New #2023 separately defines PR-revision evidence plus current-main compatibility for squash merges.

    For this issue, an artifact/receipt must be bound to the repository revision and analysis input it actually represents; a currentness claim may compare that revision with the invocation's selected repository state. That is distinct from requiring a PR branch to be rebased onto the latest main or expecting the final squash SHA to equal the reviewed PR head.

  5. EffortlessSteven commented on Jul 22, 2026

    @EffortlessSteven
    MemberAuthor

    Bounded provenance floor is in PR #2228: #2228 (head 40f6350). The canonical receipt writer now resolves actual Git HEAD, emits it when omitted, and rejects mismatched caller assertions. Focused receipt tests and applicable policy/traceability checks pass. This does not complete #1941: artifact/config/root binding, command execution, result commitments, and receipt issuance validation remain follow-up slices under #1979.

  6. EffortlessSteven commented on Jul 22, 2026

    @EffortlessSteven
    MemberAuthor

    Receipt trust slice completed in PR #2254 at exact head d6ce2e4 (pending required approving review before merge). The app-layer validator now confines and validates before/after artifacts, checks repository artifact identity and comparability, recomputes canonical agent-verify output, rejects fabricated/tampered/mismatched verify JSON with tagged errors, and passes validated parsed data into rendering. Local precommit, output-contract, generated-state, format, focused tests, clippy, traceability, spec-format, and diff checks passed; hosted required and auxiliary checks passed. This slice does not yet execute producer-issued verification commands, bind receipts to an execution run, add signatures, or complete replay/current-head policy beyond the existing artifact checks; issue #1941 remains open for those follow-ups.

  7. EffortlessSteven commented on Jul 22, 2026

    @EffortlessSteven
    MemberAuthor

    Partial delivery in flight on PR #2254 (branch security/receipt-verify-inputs-1941, head 8aed51f5).

    Landed on the branch so far

    • ripr agent receipt revalidates the bound before/after repo-exposure artifacts and recomputes canonical agent verify movement before rendering a receipt; fabricated or altered verify JSON is rejected (aecefc95).
    • Reject causes are tagged (malformed, path, artifact_read, artifact, incomparable_base_revision, incomparable_analysis_inputs, movement_recompute, canonical_render, not_canonical) instead of one opaque string (32443654) — addresses the opposition review finding.
    • Validation lives in app/agent_receipt.rs, not the CLI layer (d6ce2e46) — addresses the architecture review finding.
    • Canonical comparison is byte-exact (trailing-newline tolerant), not parsed-Value equality: compact re-serialization of real verify output is rejected, closing the codex P1 (8aed51f5, plus regression test agent_receipt_rejects_rerendered_verify_json; cli_smoke agent_receipt_ 7/7 green, clippy/fmt green).

    Remaining before this issue can close

    status/partial applies only once the PR merges; holding status/needs-work until then.

  8. EffortlessSteven commented on Jul 22, 2026

    @EffortlessSteven
    MemberAuthor

    #2254 merged (2d3171c1, required check Ripr Rust Small Result SUCCESS at head 62255ea4, 6/6 review threads resolved).

    Delivered (merged to main)

    • ripr agent receipt revalidates the bound before/after repo-exposure artifacts and recomputes canonical agent verify movement before rendering; fabricated, altered, incomparable, or re-rendered verify JSON is rejected with tagged causes (malformed, path, artifact_read, artifact, incomparable_base_revision, incomparable_analysis_inputs, movement_recompute, canonical_render, not_canonical).
    • Canonical check is byte-exact (trailing-newline tolerant), not parsed-value equality — closes the codex P1 reproduced with compact re-serialization.
    • Validation owns app/agent_receipt.rs::validate_agent_receipt_verify_json; single read/parse per artifact; CLI consumes the validated struct.
    • Smoke coverage: positive, fabricated, tampered, incomparable-base, incomparable-inputs, re-rendered, legacy alias (7/7); RIPR-SPEC-0134 amended; traceability + ImplementationSliceV1 chained.

    Residual acceptance not covered by #2254 (next owner: unassigned)

    • Head binding: receipts are not bound to an exact repo head SHA beyond the artifact identity chain.
    • Signature/attestation: no signing of receipts or verify output.
    • Re-execution: agent verify movement is recomputed from the bound artifacts, but proof commands named in the receipt are not re-executed.

    Applying status/partial: a bounded portion (canonical-input validation) has merged; the residual above remains open and actionable.

  9. added and removed
    status/needs-work
    on Jul 22, 2026
  10. EffortlessSteven commented on Jul 23, 2026

    @EffortlessSteven
    MemberAuthor

    Evidence-bound reconciliation (all-state PR search attached).

    Delivered and verified on main

    Residual

    • Fix 3 (content-hash commitment over analysis artifacts) — the issue's own "Consider" item. Partially covered by the canonical-byte validation + provenance sha256s, but no explicit artifact-hash commitment in the receipt. Needs a scoped decision: implement as a bounded additive receipt field, or record as a non-goal.
    • Signature (problem statement deps(deps): bump dtolnay/rust-toolchain from 1.95 to 1.100 in the github-actions-minor-patch group #2) — no key infrastructure exists in-repo; treating as out of scope unless a signing design is proposed.

    Keeping status/partial until the Fix-3 decision lands. Next owner: whoever picks up the receipt-hardening lane; the decision is one ADR-sized call, not new machinery.

  11. EffortlessSteven commented on Jul 23, 2026

    @EffortlessSteven
    MemberAuthor

    Residual closeout sequence after the landed provenance/contract work

    The original defect is now partially fixed, but the parent remains open because RIPR still lacks a producer-controlled execution-and-issuance path.

    New bounded slices:

    1. feat(verify): execute one producer-owned CommandSpec under bounded process policy #2332 — execute one validated producer-owned verify CommandSpec under bounded process/network/output/currentness policy and emit the landed VerificationExecutionResultV1 contract;
    2. security(receipt): issue RepairReceiptV2 only from validated movement and optional execution evidence #2333 — issue canonical RepairReceiptV2 only after revalidating/recomputing static movement and validating any optional execution result;
    3. test(receipt): adversarial execution/receipt corpus and end-to-end closeout for #1941 #2334 — run the adversarial real-binary trust journey, replay/currentness controls, packaged smoke, and retained closeout required to close this issue.

    Already-landed prerequisites remain authoritative: #1977/#2203 artifact provenance, #1978 assurance vocabulary, #2232 execution-result contract, #2218 command-spec population, #2228 actual-HEAD binding, and #2254 canonical verify-input validation.

    Sequence: #2332 → #2333 → #2334 → close #1941. Static-only receipts remain useful but visibly lower assurance throughout; no signing, correctness, mutation-adequacy, or merge-approval claim is introduced.

  12. EffortlessSteven commented on Jul 28, 2026

    @EffortlessSteven
    MemberAuthor

    Current-main reconciliation

    Verified against: 13fd9032f2b0e1a7dcbafe9c3868cad19a6a2a54

    Delivered

    Still outstanding

    Evidence

    Current disposition

    status/partial

  13. EffortlessSteven commented on Aug 1, 2026

    @EffortlessSteven
    MemberAuthor

    Resolved — HEAD binding implemented and tagged #1941 in app/receipt.rs:114-118,350-365. Writer resolves real HEAD via git rev-parse and rejects mismatches. Regression test at receipt.rs:1356. Verify path in verification_execution.rs:334-380 captures head_before/after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions