[M-5] SOAP response parsed with default xmerl options — internal entity expansion not disabled #17

Closed
opened 2026-11-14 18:28:48 +01:00 by amiryahaya · 0 comments
Owner

Finding

NationalIDClient parses Trustgate responses with :xmerl_scan.string(..., quiet: true) — no DTD/entity hardening; xmerl expands internal entities by default (billion-laughs style).

Evidence

  • lib/mdid_ws/cert_management/national_id_client.ex:226

Impact

A compromised/MITM'd Trustgate (or an SSRF-adjacent redirect) could feed crafted XML for resource exhaustion.

Fix

  • Disable entity/DTD handling in xmerl options or switch to a hardened parser

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

## Finding `NationalIDClient` parses Trustgate responses with `:xmerl_scan.string(..., quiet: true)` — no DTD/entity hardening; xmerl expands internal entities by default (billion-laughs style). ## Evidence - `lib/mdid_ws/cert_management/national_id_client.ex:226` ## Impact A compromised/MITM'd Trustgate (or an SSRF-adjacent redirect) could feed crafted XML for resource exhaustion. ## Fix - [ ] Disable entity/DTD handling in xmerl options or switch to a hardened parser _Line numbers refer to the initial import commit `282cb11`. Source: comprehensive audit, 2026-11-12 (first review of this codebase)._
Sign in to join this conversation.
No description provided.