[M-3] POST /status discloses any person's full certificate by IC enumeration (PDPA exposure) #15

Open
opened 2026-11-14 18:28:47 +01:00 by amiryahaya · 2 comments
Owner

Finding

With just a client JWT, /status returns the full DER certificate, serial and dates for an arbitrary icNumber (local or via Trustgate SOAP). Distinct error responses for existing vs non-existing ICs confirm existence.

Evidence

  • lib/mdid_ws_web/controllers/cert_management_controller.ex:472-524, 557-570

Impact

Privacy exposure of national identifiers and personal certificates (Malaysian PDPA); MyKad space is 12 structured digits — enumeration is cheap.

Fix

  • Rate-limit per caller and require caller↔subject binding for full-certificate responses
  • Consider returning status only (no DER) unless the caller is authorized for the subject

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

## Finding With just a client JWT, /status returns the full DER certificate, serial and dates for an arbitrary icNumber (local or via Trustgate SOAP). Distinct error responses for existing vs non-existing ICs confirm existence. ## Evidence - `lib/mdid_ws_web/controllers/cert_management_controller.ex:472-524, 557-570` ## Impact Privacy exposure of national identifiers and personal certificates (Malaysian PDPA); MyKad space is 12 structured digits — enumeration is cheap. ## Fix - [ ] Rate-limit per caller and require caller↔subject binding for full-certificate responses - [ ] Consider returning status only (no DER) unless the caller is authorized for the subject _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-client /status throttle plus status_full scope gating the DER (status only otherwise).

Verified fixed on main (1b6216b): per-client /status throttle plus status_full scope gating the DER (status only otherwise).
Author
Owner

Reopening: this was closed on the per-client throttle plus the status_full scope (DER only with status_full). The issue's first fix item, require a caller-to-subject binding for full-certificate responses, was not built: any client with the status scope can still query any IC and learn existence and validity dates. Throttle is 60/min per client, per node, in memory. Decide whether the throttle and scope are enough or whether a binding (for example a client-to-IC or client-to-organisation allowlist) is required.

Reopening: this was closed on the per-client throttle plus the status_full scope (DER only with status_full). The issue's first fix item, require a caller-to-subject binding for full-certificate responses, was not built: any client with the status scope can still query any IC and learn existence and validity dates. Throttle is 60/min per client, per node, in memory. Decide whether the throttle and scope are enough or whether a binding (for example a client-to-IC or client-to-organisation allowlist) is required.
Sign in to join this conversation.
No description provided.