[M-12] CRL lifecycle: revoked-before-publish, no retry/scheduler, concurrent publishes can tear the file, no nextUpdate/CRLNumber #24

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

Finding

The record is marked revoked before the CRL publish; if publish fails the client gets 500 but the record stays revoked and the on-disk CRL is stale forever (nothing re-publishes). Two concurrent revocations can interleave writes to the same crl.crl path (torn reads by relying parties). revocation reason is hardcoded :unspecified; nextUpdate/CRLNumber are left to the library defaults.

Evidence

  • lib/mdid_ws_web/controllers/cert_management_controller.ex:423-434
  • lib/mdid_ws/cert_management/crl_publisher.ex:22-31, 55-57, 97-106, 115

Impact

Stale or torn CRLs served to relying parties; no revocation-reason fidelity.

Fix

  • Publish-then-commit ordering or a retry/scheduled re-publish job
  • Atomic file publish (write temp + rename) or a per-issuer lock
  • Set nextUpdate + monotonically increasing CRLNumber; accept real revocation reasons

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

## Finding The record is marked revoked before the CRL publish; if publish fails the client gets 500 but the record stays revoked and the on-disk CRL is stale forever (nothing re-publishes). Two concurrent revocations can interleave writes to the same crl.crl path (torn reads by relying parties). revocation reason is hardcoded `:unspecified`; nextUpdate/CRLNumber are left to the library defaults. ## Evidence - `lib/mdid_ws_web/controllers/cert_management_controller.ex:423-434` - `lib/mdid_ws/cert_management/crl_publisher.ex:22-31, 55-57, 97-106, 115` ## Impact Stale or torn CRLs served to relying parties; no revocation-reason fidelity. ## Fix - [ ] Publish-then-commit ordering or a retry/scheduled re-publish job - [ ] Atomic file publish (write temp + rename) or a per-issuer lock - [ ] Set nextUpdate + monotonically increasing CRLNumber; accept real revocation reasons _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): per-issuer serialized publish, temp-file rename, nextUpdate, increasing CRLNumber, real reasons, CrlRepublisher retry (A5).

Verified fixed on main (1b6216b): per-issuer serialized publish, temp-file rename, nextUpdate, increasing CRLNumber, real reasons, CrlRepublisher retry (A5).
Sign in to join this conversation.
No description provided.