Repository navigation
fix: reject reflected CPace confirmation tags - #309
Conversation
Signed-off-by: Joshua Sargent <the-sarge@the-sarge.com>
Signed-off-by: Joshua Sargent <the-sarge@the-sarge.com>
|
Upstream context: cfrg/draft-irtf-cfrg-cpace#21 reports false explicit key confirmation when equal protocol messages and authentication tags are reflected. The editor proposal describes rejecting equal reflected tags; the September 22 update reports approval to incorporate clarification during RFC Editor review. As checked on September 23, the upstream PR remains open and draft-21 is still the published revision. This package's A/B/C ordering withholds the initiator tag until responder verification, so the upstream single-run initiator attack does not transfer directly. Internal deterministic fixtures nevertheless reproduce a conditional false-confirmation path: with equal shares and equal AD, the responder accepts its own authentic B tag reflected into C before initiator Finish. No feasible network attack forcing that condition with fresh production randomness was established. This PR adds the narrow equal-tag rejection in both Finish paths, preserving the MAC derivation and wire format. Tests cover authentic-tag reflection, empty/equal/different AD, forced equality, no Session or initiator C on rejection, state consumption/cleanup, and honest controls. The implementation-specific finding justifies the correction; final RFC wording still needs checking when the targeted specification is updated. |
Change
Upstream context: cfrg/draft-irtf-cfrg-cpace#21, including the editor discussion of rejecting reflected equal tags. The upstream clarification is pending publication; this PR is justified by the package-specific regression described below.
When public shares and associated data match, the previous responder accepts its own authentic B tag reflected as C before initiator confirmation. Both Finish paths now reject an otherwise valid peer tag equal to the local tag with ErrConfirmationFailed, before returning a Session or initiator C. No feasible network attack forcing equal shares with fresh production randomness was established.
Adds regression coverage for both roles, production randomness and forced equality, empty/equal/different AD, authentic-tag replay, no outputs on failure, state consumption, cleanup, and honest controls. Documents the security reasoning and narrow behavior-freeze exception. API, wire bytes, MAC derivation, and dependencies are unchanged.
Validation and limits
Review budget: one fully briefed RAS review, accepted-finding verification if needed, and at most one replacement review, followed by exact pushed-head local certification and all live required hosted checks.
Closes #308
Completed review and local certification
Reviewed and certified live PR head:
2a1500fa6c62bf21987937b572a3c9018e9b8761, base87528342d68d26db4a5a69386ae5647baf7d05ed.20260923T181926-6341a5b2c1f098b8d4fb7a12: zero findings / Fix First / follow-ups. Four R1 reviewers completed (Codex Astra, Codex Sol, Claude Opus, Grok); Claude Fable failed at process launch. Configured quorum was met and synthesis completed. The run did not post a RAS review to GitHub.task --silent check, andgo mod verifyall passed from the clean pushed head. The earlier committed source-validation packet remains accurately pinned to its source commit.Exact-head local certification transcript