[CRIT-2] No identity authorization: any authenticated client can impersonate or revoke any IC holder (identity + SANs taken from CSR) #2
Labels
No labels
architecture
code-quality
correctness
critical
docs
high
low
medium
ops
performance
privacy
security
tests
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
antrapol/CA-MDID-eMudhra#2
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Finding
The JWT carries only iss/aud/sub(client) — no scopes, no subject binding.
jwt_claimsis assigned by RequireJwt but no controller reads it. Subject identity (CN, serialNumber/IC, O, OU, email) is copied verbatim from the attacker-controlled CSR, and enrollment/renewal also copy CSR dNSName SANs. MyKad validation was removed in d69c944. Standalone renewal revokes the victim's valid remote cert and re-issues to the attacker's key; revocation has no ownership check at all.Evidence
lib/mdid_ws_web/plugs/require_jwt.ex:32—jwt_claimsassigned, never consumedlib/mdid_ws/cert_management/enrollment.ex:31-38, 178-189— CSR DN copied into subjectlib/mdid_ws/cert_management/renewal.ex:185-209— dNSName SANs / O / OU / email copied;renewal.ex:369-381— revokes victim's remote cert, adopts CSR commonNameImpact
Complete identity impersonation of any national-ID holder (12-digit MyKad space is enumerable): issue certs asserting arbitrary names/orgs/DNS names, and hostile revocation (= identity DoS) of any citizen's certificate.
Fix
Line numbers refer to the initial import commit
282cb11. Source: comprehensive audit, 2026-11-12 (first review of this codebase).