← Back to Pull requests

Fixes a crash when verifying a crafted VOPRF or ARC proof. #488

Open
unknown opened this pull request with 213 lines diff across 2 files
View on GitHub
unknown unknown commented on Oct 16, 2026 17:34 UTC
Author

Checklist


  • I've run tests to see all new and existing tests pass

  • I've followed the code style of the rest of the project

  • I've read the [Contribution Guidelines](CONTRIBUTING.md)

  • I've updated the documentation if necessary
  • Motivation:

    A crafted proof can crash the verifier. An all-zero proof is enough to trigger it

    The verifier recomputes the commitment s A + c B and serializes it into the challenge transcript. If that point is the identity there is no encoding, so the try! in OpenSSLCurvePoint.compressedRepresentation traps with EC_R_POINT_AT_INFINITY

    This is reachable from both sides: P384._VOPRF.PublicKey.finalize with a proof from the server, and P256._ARCV1.PrivateKey.verify with a presentation from the client

    Modifications:

  • Make OPRFGroupElement.oprfRepresentation a throwing getter ({ get throws }) so the identity's lack of an encoding is part of the existing API

  • Use try in the DLEQ and ZKP challenge transcripts, so these proofs are rejected

  • OPRF.composeFinalizeContext and the internal ARC serialize(ciphersuite:) functions now throw

  • Public non-throwing getters keep their signatures and force-try with a comment, since parsed or honestly generated points are never the identity

  • Add tests for both verifiers
  • Result:

    These proofs now throw instead of crashing. No public API change.

    The new tests crash on main and pass with this change. The full CryptoExtrasTests suite passes on macOS.

    Valid proofs aren't affected. An honest prover only produces the identity with negligible probability, and RFC 9497 already treats serializing the identity as an error.

    Fixes #487

    Diff: 213 lines (+159 / -54) across 2 files Reviewer: simonjbeaumont Review duration: 65052m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.44) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.44 · 213 lines diff across 2 files
    0.44
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.321
    Real PR Conversation Timeline
    1 comments
    "Review active on #488"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 43.6% (MEDIUM) · Higher = larger blast radius
    43.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.7% · Lower = rushed or shallow review
    44.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 24.1% · Safe to merge
    24.1%