Atom-table exhaustion denial-of-service via JSON parse_document in MDEx
leandrocp mdex
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| leandrocp mdex |
| No fix yet |
| leandrocp mdex |
| No fix yet |
Original description
Allocation of Resources Without Limits or Throttling vulnerability in leandrocp MDEx allows Excessive Allocation.
MDEx.parse_document/2 accepts a {:json, json} source. In lib/mdex.ex, the private json_to_node/1 function passes the attacker-controlled node_type value to Module.concat/1, which calls String.to_atom/1 and interns a brand-new atom for every distinct value. Atoms are never garbage collected on the BEAM, so a crafted JSON document carrying a unique node_type at each (deeply nested) node mints one permanent atom per node.