Skip to content

test(sdk-lib-mpc): add DKLS replay/stale-round negative tests - #9441

Open
mmcshinsky-bitgo wants to merge 1 commit into
masterfrom
pt-000000-mpc-threat-model-tests
Open

test(sdk-lib-mpc): add DKLS replay/stale-round negative tests#9441
mmcshinsky-bitgo wants to merge 1 commit into
masterfrom
pt-000000-mpc-threat-model-tests

Conversation

@mmcshinsky-bitgo

@mmcshinsky-bitgo mmcshinsky-bitgo commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • (TPA-08 audit follow-up): add negative tests for the DKLS (ECDSA MPCv2) signing session covering two adversarial scenarios flagged as a coverage gap:
    • round messages replayed from an independent, concurrent sign session into an unrelated session signing the same message
    • a stale round-3 message replayed into a session that has already advanced to round 4
  • Both new tests confirm the wasm bindings reject these inputs (throw) rather than silently accepting them.

Test plan

  • Ran modules/sdk-lib-mpc DKLS Dsg suite locally (mocha --require tsx --node-option experimental-wasm-modules, filtered via --grep): both new tests pass, along with all 11 pre-existing cases in the file.
  • Ran the same suite unfiltered multiple times to check for regressions.

Note on suite-wide flakiness (not caused by this change)

While verifying, the broader sdk-lib-mpc test suite intermittently throws Uncaught Error: recursive use of an object detected which would lead to unsafe aliasing in rust from the DKLS wasm bindings' FinalizationRegistry callback. This reproduces in unrelated files (test/unit/curves/secp256k1.ts, test/unit/tss/ecdsa/dlogproofs.ts) both with and without this PR's changes — it's a pre-existing GC-timing race in the wasm session cleanup, not something introduced here. This matches a gap already called out in the architecture audit (TPA-08: "review exception paths for WASM/session cleanup... whether serialized session state is always encrypted and integrity-protected"). Flagging here for visibility; not in scope for this test-only PR.

@mmcshinsky-bitgo
mmcshinsky-bitgo force-pushed the pt-000000-mpc-threat-model-tests branch from 5aa5b4c to c07b697 Compare August 6, 2026 23:01
Cover two adversarial scenarios flagged by the TPA-08 audit gap:
- round messages replayed from an independent, concurrent sign session
  into an unrelated session signing the same message
- a stale round-3 message replayed after a session has already
  advanced to round 4

Both are rejected by the DKLS wasm bindings rather than silently
accepted.
@mmcshinsky-bitgo
mmcshinsky-bitgo marked this pull request as ready for review August 6, 2026 23:03
@mmcshinsky-bitgo
mmcshinsky-bitgo requested review from a team as code owners August 6, 2026 23:03
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