Skip to content

Address critical/high/medium audit findings in export-and-sign#116

Closed
ethankonk wants to merge 1 commit intotkhq:mainfrom
turnkeyintern:fix/security-audit-critical-high-medium
Closed

Address critical/high/medium audit findings in export-and-sign#116
ethankonk wants to merge 1 commit intotkhq:mainfrom
turnkeyintern:fix/security-audit-critical-high-medium

Conversation

@ethankonk
Copy link
Contributor

  • Constant-time string comparison (timingSafeEqual) for org ID and enclave quorum public key checks to prevent timing side-channel attacks
  • In-place key map mutation instead of spread-copy to avoid multiplying key material references on the V8 heap
  • Zero sensitive Uint8Array buffers (secretKey, privateKeyBytes, pkcs8) on all code paths including error paths via finally blocks
  • Origin validation on incoming postMessage events using allowedOrigin captured during the TURNKEY_INIT_MESSAGE_CHANNEL handshake
  • Use captured parent origin as targetOrigin in sendMessageUp instead of wildcard '*' to prevent message eavesdropping
  • Reduce embedded key localStorage TTL from 48h to 4h to limit exposure window if storage is compromised
  • Add tests for all new security behaviors: timing-safe comparison, parent origin capture/send, TTL enforcement, key clearing with buffer zeroing, and origin-scoped postMessage

…and-sign

- Constant-time string comparison (timingSafeEqual) for org ID and enclave
  quorum public key checks to prevent timing side-channel attacks
- In-place key map mutation instead of spread-copy to avoid multiplying
  key material references on the V8 heap
- Zero sensitive Uint8Array buffers (secretKey, privateKeyBytes, pkcs8)
  on all code paths including error paths via finally blocks
- Origin validation on incoming postMessage events using allowedOrigin
  captured during the TURNKEY_INIT_MESSAGE_CHANNEL handshake
- Use captured parent origin as targetOrigin in sendMessageUp instead
  of wildcard '*' to prevent message eavesdropping
- Reduce embedded key localStorage TTL from 48h to 4h to limit exposure
  window if storage is compromised
- Add tests for all new security behaviors: timing-safe comparison,
  parent origin capture/send, TTL enforcement, key clearing with buffer
  zeroing, and origin-scoped postMessage
@ethankonk ethankonk closed this Mar 4, 2026
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