[H-7] Unbounded Mnesia growth: token rows (full JWT strings), certificate_request rows, login_attempt rows never purged #11
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#11
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
:oauth_access_tokenstores the entire signed JWT per issuance and is never read or deleted.:certificate_requestrows live forever (only 'cleanup' is the table-wiping script 11).:login_attemptrows for never-retried identifiers persist forever; attackers churning client_ids create unlimited rows.Evidence
lib/mdid_ws/oauth/token.ex:124-136— full JWT stored, zero deletions anywherelib/mdid_ws/auth/rate_limiter.ex:92-104— row per unique ip:client_idscripts/11_clear_cert_requests.sh— wipes the whole tableImpact
Persistent disc exhaustion on the CA volume; amplifies the scan cost in H-6.
Fix
Process.send_after) deleting expired tokens (expires_at is already stored) and stale login attemptsLine numbers refer to the initial import commit
282cb11. Source: comprehensive audit, 2026-11-12 (first review of this codebase).