[M-13] Durability: async :mnesia.transaction for issuance/revocation — sync_transaction (wrap_with) implemented but never called #25

Closed
opened 2026-11-14 18:28:52 +01:00 by amiryahaya · 1 comment
Owner

Finding

All data stores use async transactions (disc dump lag). A crash right after HTTP 201 can lose the issuance record while the client holds a real certificate (OCSP then answers unknown; local revocation impossible). Every store already implements wrap_with → sync_transaction with zero callers.

Evidence

  • e.g. lib/mdid_ws/oauth/client_data_store.ex:42, 103-105

Impact

Certificate/state divergence after crashes — integrity issue for a CA.

Fix

  • Use sync_transaction for issuance and revocation writes (the tooling already exists)

Line numbers refer to the initial import commit 282cb11. Source: comprehensive audit, 2026-11-12 (first review of this codebase).

## Finding All data stores use async transactions (disc dump lag). A crash right after HTTP 201 can lose the issuance record while the client holds a real certificate (OCSP then answers `unknown`; local revocation impossible). Every store already implements `wrap_with` → `sync_transaction` with zero callers. ## Evidence - e.g. `lib/mdid_ws/oauth/client_data_store.ex:42, 103-105` ## Impact Certificate/state divergence after crashes — integrity issue for a CA. ## Fix - [ ] Use `sync_transaction` for issuance and revocation writes (the tooling already exists) _Line numbers refer to the initial import commit `282cb11`. Source: comprehensive audit, 2026-11-12 (first review of this codebase)._
Author
Owner

Verified fixed on main (1b6216b): stores write via sync_transaction (MnesiaStore, Issuer) (A5).

Verified fixed on main (1b6216b): stores write via sync_transaction (MnesiaStore, Issuer) (A5).
Sign in to join this conversation.
No description provided.