Skip to content

fix(sdk-lib-mpc): replace date:null with tolerance window in OpenPGP calls#8469

Open
zahin-mohammad wants to merge 1 commit intomasterfrom
zahinmohammad/wal-379-security-openpgp-date-null-disables-signature-expiry-enables
Open

fix(sdk-lib-mpc): replace date:null with tolerance window in OpenPGP calls#8469
zahin-mohammad wants to merge 1 commit intomasterfrom
zahinmohammad/wal-379-security-openpgp-date-null-disables-signature-expiry-enables

Conversation

@zahin-mohammad
Copy link
Copy Markdown
Contributor

@zahin-mohammad zahin-mohammad commented Apr 9, 2026

Summary

Fixes the date: null → tolerance window migration in OpenPGP comms layer. The original change (date: now + 24h) was stricter than default, not more tolerant — it required keys to be valid for 24 more hours instead of tolerating recently-expired keys.

What changed

  • encrypt/decrypt: Removed date override entirely (uses default = current time). Normal key expiry and self-signature validation.
  • verify: Kept date: now + 24h. Tolerates signatures from OVC devices whose clocks are up to 24h ahead.

Why not now - 24h for encrypt?

OpenPGP's date parameter shifts the reference time for ALL temporal checks simultaneously. Using now - 24h tolerates expired keys but breaks self-signature validation on any key created within the last 24h ("Signature creation time is in the future").

Impact on client SDK with clock skew

Clock ahead (e.g. +4h): Signature verification on the server works fine. But when the client SDK encrypts a message to the server's HSM key, it checks key validity using its wrong clock. If the HSM key expires in 3 hours (real time), the client thinks it expired 1 hour ago → encrypt fails unnecessarily.

Clock behind (e.g. -4h): Everything works fine. Signatures appear slightly old (no problem). Keys appear to have more time left (no problem).

Failure scenarios compared to date: null

  1. Server's HSM key is expiredpgp.encrypt rejects it. Client cannot send messages to the server. This is the intended security improvement.
  2. Server's HSM key is still valid, but client clock is ahead by more than the key's remaining lifetimepgp.encrypt rejects it. Unintended collateral — previously tolerated by date: null.
  3. A signature is timestamped more than 24h in the future relative to the verifier → pgp.verify rejects it. Practically impossible since the server's clock is correct.

Test plan

  • Existing encrypt/decrypt/verify round-trip tests pass
  • Existing DKG ceremony tests pass
  • New test: expired key is rejected for encryption
  • New test: signature from a clock 12h ahead is accepted (within tolerance)
  • New test: signature from a clock 25h ahead is rejected (beyond tolerance)

Ticket: WAL-379

🤖 Generated with Claude Code

@linear
Copy link
Copy Markdown

linear bot commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

@Logicwax Logicwax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our silencelabs DKLS23 protocol should be tolerant of re-play attacks. and we had issues with this affecting customers before due to clock skew. how about we compromise in the middle and make it like 24 hours? that way it shows we considered this (for future audits), but also enough slack for customers with terrible clocks.

@zahin-mohammad zahin-mohammad force-pushed the zahinmohammad/wal-379-security-openpgp-date-null-disables-signature-expiry-enables branch 3 times, most recently from 67f18f9 to e4d5ef3 Compare April 10, 2026 02:47
…calls

Remove `date: null as unknown as undefined` from OpenPGP encrypt/decrypt
calls (use default current-time checks) and replace it with
`now + 24h` on verify calls only, to tolerate signatures from OVC
devices whose clocks are up to 24 hours ahead.

OpenPGP's date parameter shifts ALL temporal checks simultaneously,
so a single shifted date cannot independently relax key-expiry checks
without breaking self-signature validation on fresh keys.

Ticket: WAL-379

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@zahin-mohammad zahin-mohammad force-pushed the zahinmohammad/wal-379-security-openpgp-date-null-disables-signature-expiry-enables branch from e4d5ef3 to 884d91e Compare April 10, 2026 02:47
@zahin-mohammad zahin-mohammad marked this pull request as ready for review April 10, 2026 03:04
@zahin-mohammad zahin-mohammad requested review from a team as code owners April 10, 2026 03:04
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.

2 participants