CVE-2026-140436: yaml_elixir: exponential alias expansion in YamlElixir.Mapper allows memory exhaustion
Improper Restriction of Recursive Entity References vulnerability in YamlElixir.Mapper in KamilLelonek yamlelixir allows an attacker to exhaust the memory of the BEAM node via a YAML document with nested anchors and aliases.
yamerl 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/yamlelixir/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.
This issue affects yamlelixir: from 0.0.1 before 2.13.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
yaml_elixirto a version that resolves this vulnerability.Fixed in 2.13.0
Event History
Frequently Asked Questions
Who is exposed to this issue?
Applications using yaml_elixir versions from 0.0.1 up to, but not including, 2.13.0 are affected when they parse YAML through any YamlElixir.read_* function with default options. Exposure is most relevant where an attacker can supply or influence the YAML being parsed.
What does an attacker need to exploit it?
The attacker needs to cause the application to parse a crafted YAML document containing nested anchors and aliases. The mapper expands aliases by copying anchored nodes, causing memory consumption to grow exponentially with nesting depth and potentially exhausting the BEAM node's memory.
Are default settings affected?
Yes. All YamlElixir.read_* functions are affected with their default options.
How can I determine whether my application is affected?
Check whether the application depends on yaml_elixir and whether the resolved version is earlier than 2.13.0. Then identify uses of YamlElixir.read_* that may parse YAML supplied or influenced by untrusted parties.