CVE-2026-140436
yaml_ elixir: exponential alias expansion in YamlElixir. Mapper allows memory exhaustion (Hex)
- Severity
- 6.9MediumLocal attack, no privileges, no user interactionCVSS 4.0, CVE List
- Exploitation
- UnknownNo source reports exploitation yet.
- Exploit chance
- 0.25% in 30 daysPercentile17thEPSS, scored
- Listed fix
2.13.0for yaml_elixir From OSV
Overview
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.
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/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.
This issue affects yaml_elixir: from 0.0.1 before 2.13.0.
CVSS 4.0 vector
Exploitability
- Attack vector
- Local
- Complexity
- Low
- Attack requirements
- None
- Privileges needed
- None
- User interaction
- None
Impact on the vulnerable system
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Impact on subsequent systems
- Confidentiality
- None
- Integrity
- None
- Availability
- None
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:NExploit chance over time
Scored once so far, on . The trend appears after a second daily score.
Affected
Packages 1
| Package | Affected | Fixed |
|---|---|---|
yaml_elixirHex | 0.0.1 up to 2.13.0, plus listed versions 1.0.01.1.01.2.01.2.11.2.2 Show 21 more versionsShow less1.3.01.3.11.3.21.4.02.0.02.0.12.0.22.1.02.10.02.11.02.12.02.12.12.12.22.2.02.3.02.4.02.5.02.6.02.7.02.8.02.9.0 | 2.13.0 |
Products 1
Sources
CVE List Score usedCVSS 4.06.9
yaml_elixir: exponential alias expansion in YamlElixir.Mapper allows memory exhaustion
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.
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/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.
This issue affects yaml_elixir: from 0.0.1 before 2.13.0.
- Record
CVE-2026-140436- CVSS 4.0
- 6.9 Medium
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 - Weakness
- CWE-776
- Updated
- 2026-12-04
EUVDEUVD-2026-144051CVSS 4.06.9
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.
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/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.
This issue affects yaml_elixir: from 0.0.1 before 2.13.0.
- Record
EUVD-2026-144051- CVSS 4.0
- 6.9 Medium
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 - Updated
- 2026-12-04
GitHub AdvisoriesGHSA-9p7h-7wgp-w94mCVSS 4.06.9
Improper Restriction of Recursive Entity References vulnerability in YamlElixir.Mapper in...
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.
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/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.
This issue affects yaml_elixir: from 0.0.1 before 2.13.0.
- Record
GHSA-9p7h-7wgp-w94m- CVSS 4.0
- 6.9 Medium
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Weakness
- CWE-776
- Updated
- 2026-12-04
NVDCVSS 4.06.9
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.
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/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.
This issue affects yaml_elixir: from 0.0.1 before 2.13.0.
- Record
CVE-2026-140436- CVSS 4.0
- 6.9 Medium
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Weakness
- CWE-776
- Updated
- 2026-12-04
OSVCVSS 4.06.9
yaml_elixir: exponential alias expansion in YamlElixir.Mapper allows memory exhaustion
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.
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/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.
This issue affects yaml_elixir: from 0.0.1 before 2.13.0.
- Record
CVE-2026-140436- CVSS 4.0
- 6.9 Medium
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 - Weakness
- CWE-776
- Updated
- 2026-12-04
OSVEEF-CVE-2026-140436CVSS 4.06.9
yaml_elixir: exponential alias expansion in YamlElixir.Mapper allows memory exhaustion
Summary
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.
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/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.
This issue affects yaml_elixir: from 0.0.1 before 2.13.0.
Details
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.
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.
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.
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.
Proof of concept
- Build a YAML document with the key
l0, whose value has the anchor&l0and is a sequence of 9 strings. - Add the keys
l1tol8. The value ofl<i>has the anchor&l<i>and is a sequence of 9 aliases*l<i-1>. The document has 720 bytes. - Call
YamlElixir.read_from_string/1with the document in a process whosemax_heap_sizeis 1 GiB withkill: true. - 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}}.
Impact
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.
Workarounds
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.
- Record
EEF-CVE-2026-140436- CVSS 4.0
- 6.9 Medium
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 - Weakness
- CWE-776
- Updated
- 2026-12-04
History
Recorded by Every CVE
| Day | Changed | Sources |
|---|---|---|
| References | OSV | |
| Published date | EUVD | |
| Published date | EUVD | |
| Other IDs, references, severity | GitHub Advisories | |
| Other IDs, published date, references | EUVD, OSV | |
| Severity | NVD | |
| Affected packages, other IDs, key facts, references | OSV | |
| First indexed | CVE List |
Upstream dates may differ.
References
github.com/KamilLelonek/yaml-elixir/security/advisories/GHSA-598v-rvxm-fcp8
cna.erlef.org/cves/CVE-2026-140436.html
osv.dev/vulnerability/EEF-CVE-2026-140436
github.com/KamilLelonek/yaml-elixir/commit/dd8e152738f2396c16bf537267fe0f4ce66cada4
github.com/KamilLelonek/yaml-elixir/commit/add27450860201caf63ea445a1e6f00ce8267250
nvd.nist.gov/vuln/detail/CVE-2026-140436
github.com/advisories/GHSA-9p7h-7wgp-w94m
github.com