Уязвимость «Распределение ресурсов без ограничений» или «Регулирование» в Leandrocp MDEx допускает чрезмерное распределение. MDEx.parse_document/2 принимает источник {:json, json}. В lib/mdex.ex частная функция json_to_node/1 передает контролируемое злоумышленником значение node_type в Module.concat/1, который вызывает String.to_atom/1 и помещает совершенно новый атом для каждого отдельного значения.
Атомы никогда не собираются в мусор в BEAM, поэтому созданный документ JSON, содержащий уникальный node_type на каждом (глубоко вложенном) узле, создает один постоянный атом на каждый узел. Один документ может интернировать сотни тысяч атомов, а достаточно большой документ исчерпывает таблицу атомов по умолчанию (около 1 048 576 атомов) и прерывает работу всей виртуальной машины Erlang, останавливая каждый процесс на узле. Любое приложение, которое передает ненадежные входные данные в источник {:json, ...} MDEx.parse_document, подвергается неаутентифицированному отказу в обслуживании.
Эта проблема затрагивает mdex с 0.4.3 до 0.13.2.
Показать оригинальное описание (EN)
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. A single document can intern hundreds of thousands of atoms, and a large enough document exhausts the default atom table (around 1,048,576 atoms) and aborts the entire Erlang VM, taking down every process on the node. Any application that passes untrusted input to the {:json, ...} source of MDEx.parse_document is exposed to an unauthenticated denial-of-service. This issue affects mdex: from 0.4.3 before 0.13.2.
Характеристики атаки
Последствия
Строка CVSS v4.0