{"containers":{"cna":{"affected":[{"collectionURL":"https://repo.hex.pm","cpes":["cpe:2.3:a:kamillelonek:yaml_elixir:*:*:*:*:*:*:*:*"],"defaultStatus":"unaffected","modules":["'Elixir.YamlElixir.Mapper'","'Elixir.YamlElixir'"],"packageName":"yaml_elixir","packageURL":"pkg:hex/yaml_elixir","product":"yaml_elixir","programFiles":["lib/yaml_elixir/mapper.ex","lib/yaml_elixir.ex"],"programRoutines":[{"name":"'Elixir.YamlElixir.Mapper':process/1"},{"name":"'Elixir.YamlElixir.Mapper':process/2"},{"name":"'Elixir.YamlElixir.Mapper':'_to_map'/1"},{"name":"'Elixir.YamlElixir.Mapper':'_to_map'/2"},{"name":"'Elixir.YamlElixir':read_from_string/1"},{"name":"'Elixir.YamlElixir':read_from_string/2"},{"name":"'Elixir.YamlElixir':read_from_file/1"},{"name":"'Elixir.YamlElixir':read_from_file/2"},{"name":"'Elixir.YamlElixir':read_all_from_string/1"},{"name":"'Elixir.YamlElixir':read_all_from_string/2"},{"name":"'Elixir.YamlElixir':read_all_from_file/1"},{"name":"'Elixir.YamlElixir':read_all_from_file/2"},{"name":"'Elixir.YamlElixir':'read_from_string!'/1"},{"name":"'Elixir.YamlElixir':'read_from_string!'/2"},{"name":"'Elixir.YamlElixir':'read_from_file!'/1"},{"name":"'Elixir.YamlElixir':'read_from_file!'/2"},{"name":"'Elixir.YamlElixir':'read_all_from_string!'/1"},{"name":"'Elixir.YamlElixir':'read_all_from_string!'/2"},{"name":"'Elixir.YamlElixir':'read_all_from_file!'/1"},{"name":"'Elixir.YamlElixir':'read_all_from_file!'/2"}],"repo":"https://github.com/KamilLelonek/yaml-elixir","vendor":"KamilLelonek","versions":[{"lessThan":"2.13.0","status":"affected","version":"0.0.1","versionType":"semver"}]},{"collectionURL":"https://github.com","cpes":["cpe:2.3:a:kamillelonek:yaml_elixir:*:*:*:*:*:*:*:*"],"defaultStatus":"unaffected","modules":["'Elixir.YamlElixir.Mapper'","'Elixir.YamlElixir'"],"packageName":"kamillelonek/yaml-elixir","packageURL":"pkg:github/kamillelonek/yaml-elixir","product":"yaml_elixir","programFiles":["lib/yaml_elixir/mapper.ex","lib/yaml_elixir.ex"],"programRoutines":[{"name":"'Elixir.YamlElixir.Mapper':process/1"},{"name":"'Elixir.YamlElixir.Mapper':process/2"},{"name":"'Elixir.YamlElixir.Mapper':'_to_map'/1"},{"name":"'Elixir.YamlElixir.Mapper':'_to_map'/2"},{"name":"'Elixir.YamlElixir':read_from_string/1"},{"name":"'Elixir.YamlElixir':read_from_string/2"},{"name":"'Elixir.YamlElixir':read_from_file/1"},{"name":"'Elixir.YamlElixir':read_from_file/2"},{"name":"'Elixir.YamlElixir':read_all_from_string/1"},{"name":"'Elixir.YamlElixir':read_all_from_string/2"},{"name":"'Elixir.YamlElixir':read_all_from_file/1"},{"name":"'Elixir.YamlElixir':read_all_from_file/2"},{"name":"'Elixir.YamlElixir':'read_from_string!'/1"},{"name":"'Elixir.YamlElixir':'read_from_string!'/2"},{"name":"'Elixir.YamlElixir':'read_from_file!'/1"},{"name":"'Elixir.YamlElixir':'read_from_file!'/2"},{"name":"'Elixir.YamlElixir':'read_all_from_string!'/1"},{"name":"'Elixir.YamlElixir':'read_all_from_string!'/2"},{"name":"'Elixir.YamlElixir':'read_all_from_file!'/1"},{"name":"'Elixir.YamlElixir':'read_all_from_file!'/2"}],"repo":"https://github.com/KamilLelonek/yaml-elixir","vendor":"KamilLelonek","versions":[{"lessThan":"add27450860201caf63ea445a1e6f00ce8267250","status":"affected","version":"dd8e152738f2396c16bf537267fe0f4ce66cada4","versionType":"git"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:a:kamillelonek:yaml_elixir:*:*:*:*:*:*:*:*","versionEndExcluding":"2.13.0","versionStartIncluding":"0.0.1","vulnerable":true}],"negate":false,"operator":"OR"}],"operator":"AND"}],"credits":[{"lang":"en","type":"finder","value":"Marc Nickert / intcube GmbH"},{"lang":"en","type":"reporter","value":"Marc Nickert / intcube GmbH"},{"lang":"en","type":"coordinator","value":"Jonatan Männchen / EEF"},{"lang":"en","type":"coordinator","value":"Marc Nickert / intcube GmbH"},{"lang":"en","type":"remediation developer","value":"Kamil Lelonek"}],"dateAssigned":"2026-12-03T17:40:59.000Z","datePublic":"2026-12-03T23:01:41.000Z","descriptions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>Improper Restriction of Recursive Entity References vulnerability in <code>YamlElixir.Mapper</code> in KamilLelonek yaml_elixir allows an attacker to exhaust the memory of the BEAM node via a YAML document with nested anchors and aliases.</p>\n<p>yamerl resolves each alias to the term of its anchor, so the parsed document stays as small as the input. <code>YamlElixir.Mapper.process/2</code> in <code>lib/yaml_elixir/mapper.ex</code> walks that document as a tree and builds a new copy of the anchored node for every alias. With nested anchors, the size of the result grows exponentially with the nesting depth. All <code>YamlElixir.read_*</code> functions are affected with their default options.</p>\n<p>This issue affects yaml_elixir: from 0.0.1 before 2.13.0.</p>"},{"base64":false,"type":"text/markdown","value":"Improper Restriction of Recursive Entity References vulnerability in `YamlElixir.Mapper` in KamilLelonek yaml_elixir allows an attacker to exhaust the memory of the BEAM node via a YAML document with nested anchors and aliases.\n\nyamerl resolves each alias to the term of its anchor, so the parsed document stays as small as the input. `YamlElixir.Mapper.process/2` in `lib/yaml_elixir/mapper.ex` walks that document as a tree and builds a new copy of the anchored node for every alias. With nested anchors, the size of the result grows exponentially with the nesting depth. All `YamlElixir.read_*` functions are affected with their default options.\n\nThis issue affects yaml_elixir: from 0.0.1 before 2.13.0."}],"value":"Improper Restriction of Recursive Entity References vulnerability in YamlElixir.Mapper in KamilLelonek yaml_elixir allows an attacker to exhaust the memory of the BEAM node via a YAML document with nested anchors and aliases.\n\nyamerl resolves each alias to the term of its anchor, so the parsed document stays as small as the input. YamlElixir.Mapper.process/2 in lib/yaml_elixir/mapper.ex walks that document as a tree and builds a new copy of the anchored node for every alias. With nested anchors, the size of the result grows exponentially with the nesting depth. All YamlElixir.read_* functions are affected with their default options.\n\nThis issue affects yaml_elixir: from 0.0.1 before 2.13.0."}],"impacts":[{"capecId":"CAPEC-197","descriptions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>An attacker who can make an application parse a YAML document of their choice can exhaust the memory of the parsing process. A BEAM process has no heap limit by default, so the node can run out of memory and stop, which ends every application on it.</p>"},{"base64":false,"type":"text/markdown","value":"An attacker who can make an application parse a YAML document of their choice can exhaust the memory of the parsing process. A BEAM process has no heap limit by default, so the node can run out of memory and stop, which ends every application on it."}],"value":"An attacker who can make an application parse a YAML document of their choice can exhaust the memory of the parsing process. A BEAM process has no heap limit by default, so the node can run out of memory and stop, which ends every application on it."}]}],"metrics":[{"cvssV4_0":{"Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","Safety":"NOT_DEFINED","attackComplexity":"LOW","attackRequirements":"NONE","attackVector":"LOCAL","baseScore":6.9,"baseSeverity":"MEDIUM","privilegesRequired":"NONE","providerUrgency":"NOT_DEFINED","subAvailabilityImpact":"NONE","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","userInteraction":"NONE","valueDensity":"NOT_DEFINED","vectorString":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","version":"4.0","vulnAvailabilityImpact":"HIGH","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"NONE","vulnerabilityResponseEffort":"NOT_DEFINED"},"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}]}],"problemTypes":[{"descriptions":[{"cweId":"CWE-776","description":"CWE-776 Improper Restriction of Recursive Entity References in DTDs","lang":"en","type":"CWE"}]}],"providerMetadata":{"dateUpdated":"2026-12-04T06:31:06.132Z","orgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","shortName":"EEF"},"references":[{"name":"Exponential alias expansion in YamlElixir.Mapper lets a small YAML document exhaust BEAM memory (CVE-2026-140436)","tags":["vendor-advisory","related"],"url":"https://github.com/KamilLelonek/yaml-elixir/security/advisories/GHSA-598v-rvxm-fcp8"},{"name":"EEF CNA record for CVE-2026-140436","tags":["related"],"url":"https://cna.erlef.org/cves/CVE-2026-140436.html"},{"name":"OSV record EEF-CVE-2026-140436","tags":["related"],"url":"https://osv.dev/vulnerability/EEF-CVE-2026-140436"},{"name":"Introducing commit dd8e152 in KamilLelonek/yaml-elixir","tags":["related"],"url":"https://github.com/KamilLelonek/yaml-elixir/commit/dd8e152738f2396c16bf537267fe0f4ce66cada4"},{"name":"Fix commit add2745 in KamilLelonek/yaml-elixir","tags":["patch"],"url":"https://github.com/KamilLelonek/yaml-elixir/commit/add27450860201caf63ea445a1e6f00ce8267250"}],"source":{"discovery":"EXTERNAL"},"title":"yaml_elixir: exponential alias expansion in YamlElixir.Mapper allows memory exhaustion","workarounds":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>Parse untrusted YAML in a separate process that has a <code>max_heap_size</code> limit with <code>kill: true</code>, set with <code>Process.flag/2</code>. The runtime then stops only that process when the conversion exceeds the limit.</p>"},{"base64":false,"type":"text/markdown","value":"Parse untrusted YAML in a separate process that has a `max_heap_size` limit with `kill: true`, set with `Process.flag/2`. The runtime then stops only that process when the conversion exceeds the limit."}],"value":"Parse untrusted YAML in a separate process that has a max_heap_size limit with kill: true, set with Process.flag/2. The runtime then stops only that process when the conversion exceeds the limit."}],"x_proofOfConcept":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<ol>\n<li>Build a YAML document with the key <code>l0</code>, whose value has the anchor <code>&amp;l0</code> and is a sequence of 9 strings.</li>\n<li>Add the keys <code>l1</code> to <code>l8</code>. The value of <code>l&lt;i&gt;</code> has the anchor <code>&amp;l&lt;i&gt;</code> and is a sequence of 9 aliases <code>*l&lt;i-1&gt;</code>. The document has 720 bytes.</li>\n<li>Call <code>YamlElixir.read_from_string/1</code> with the document in a process whose <code>max_heap_size</code> is 1 GiB with <code>kill: true</code>.</li>\n<li>On 2.12.2 the runtime kills the process at the heap limit. On 2.13.0 the call returns <code>{:error, %YamlElixir.ParsingError{type: :max_nodes_exceeded}}</code>.</li>\n</ol>"},{"base64":false,"type":"text/markdown","value":"1. Build a YAML document with the key `l0`, whose value has the anchor `&l0` and is a sequence of 9 strings.\n2. Add the keys `l1` to `l8`. The value of `l<i>` has the anchor `&l<i>` and is a sequence of 9 aliases `*l<i-1>`. The document has 720 bytes.\n3. Call `YamlElixir.read_from_string/1` with the document in a process whose `max_heap_size` is 1 GiB with `kill: true`.\n4. On 2.12.2 the runtime kills the process at the heap limit. On 2.13.0 the call returns `{:error, %YamlElixir.ParsingError{type: :max_nodes_exceeded}}`."}],"value":"* Build a YAML document with the key l0, whose value has the anchor &l0 and is a sequence of 9 strings.\n* Add the keys l1 to l8. The value of l<i> has the anchor &l<i> and is a sequence of 9 aliases *l<i-1>. The document has 720 bytes.\n* Call YamlElixir.read_from_string/1 with the document in a process whose max_heap_size is 1 GiB with kill: true.\n* On 2.12.2 the runtime kills the process at the heap limit. On 2.13.0 the call returns {:error, %YamlElixir.ParsingError{type: :max_nodes_exceeded}}."}],"x_technicalAnalysis":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p><strong>1. Parsing.</strong> <code>YamlElixir.read_from_string/2</code> and the other read functions call <code>:yamerl_constr.string/2</code> or <code>:yamerl_constr.file/2</code>. For each alias, yamerl returns the same node term as for the anchor, so its result is about as small as the input.</p>\n<p><strong>2. Conversion.</strong> <code>YamlElixir.Mapper.process/2</code> passes the document to <code>_to_map/2</code> in <code>lib/yaml_elixir/mapper.ex</code>. <code>_to_map/2</code> recurses into each sequence and mapping and builds a new list or map for each node that it visits. It keeps no record of converted nodes, so it converts an anchored node once per alias.</p>\n<p><strong>3. Growth.</strong> When each anchored node holds several aliases of the previous anchored node, the number of built nodes is multiplied at each level. The <code>merge_anchors: true</code> option walks the converted result one more time.</p>\n<p><strong>4. Measurement.</strong> The test document has one anchored sequence of 9 strings and, per level, one anchored sequence of 9 aliases of the previous level. On 2.12.2, a 560-byte document (6 levels) exceeded a process heap limit of 256 MiB, and a 720-byte document (8 levels) exceeded a limit of 1 GiB. On 2.13.0, both documents gave a <code>YamlElixir.ParsingError</code> of type <code>:max_nodes_exceeded</code> with 21 MiB of process memory. The fix counts each node that <code>_to_map/2</code> builds and stops at the <code>:max_nodes</code> limit. The default limit is 1,000,000 nodes or the input size in bytes, whichever is larger.</p>"},{"base64":false,"type":"text/markdown","value":"**1. Parsing.** `YamlElixir.read_from_string/2` and the other read functions call `:yamerl_constr.string/2` or `:yamerl_constr.file/2`. For each alias, yamerl returns the same node term as for the anchor, so its result is about as small as the input.\n\n**2. Conversion.** `YamlElixir.Mapper.process/2` passes the document to `_to_map/2` in `lib/yaml_elixir/mapper.ex`. `_to_map/2` recurses into each sequence and mapping and builds a new list or map for each node that it visits. It keeps no record of converted nodes, so it converts an anchored node once per alias.\n\n**3. Growth.** When each anchored node holds several aliases of the previous anchored node, the number of built nodes is multiplied at each level. The `merge_anchors: true` option walks the converted result one more time.\n\n**4. Measurement.** The test document has one anchored sequence of 9 strings and, per level, one anchored sequence of 9 aliases of the previous level. On 2.12.2, a 560-byte document (6 levels) exceeded a process heap limit of 256 MiB, and a 720-byte document (8 levels) exceeded a limit of 1 GiB. On 2.13.0, both documents gave a `YamlElixir.ParsingError` of type `:max_nodes_exceeded` with 21 MiB of process memory. The fix counts each node that `_to_map/2` builds and stops at the `:max_nodes` limit. The default limit is 1,000,000 nodes or the input size in bytes, whichever is larger."}],"value":"1. Parsing. YamlElixir.read_from_string/2 and the other read functions call :yamerl_constr.string/2 or :yamerl_constr.file/2. For each alias, yamerl returns the same node term as for the anchor, so its result is about as small as the input.\n\n2. Conversion. YamlElixir.Mapper.process/2 passes the document to _to_map/2 in lib/yaml_elixir/mapper.ex. _to_map/2 recurses into each sequence and mapping and builds a new list or map for each node that it visits. It keeps no record of converted nodes, so it converts an anchored node once per alias.\n\n3. Growth. When each anchored node holds several aliases of the previous anchored node, the number of built nodes is multiplied at each level. The merge_anchors: true option walks the converted result one more time.\n\n4. Measurement. The test document has one anchored sequence of 9 strings and, per level, one anchored sequence of 9 aliases of the previous level. On 2.12.2, a 560-byte document (6 levels) exceeded a process heap limit of 256 MiB, and a 720-byte document (8 levels) exceeded a limit of 1 GiB. On 2.13.0, both documents gave a YamlElixir.ParsingError of type :max_nodes_exceeded with 21 MiB of process memory. The fix counts each node that _to_map/2 builds and stops at the :max_nodes limit. The default limit is 1,000,000 nodes or the input size in bytes, whichever is larger."}]}},"cveMetadata":{"assignerOrgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","assignerShortName":"EEF","cveId":"CVE-2026-140436","datePublished":"2026-12-04T06:31:06.132Z","dateReserved":"2026-12-02T10:26:07.288Z","dateUpdated":"2026-12-04T06:31:06.132Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"}