CVE-2026-75758: Unbounded recursion between Inspect.List charlist rendering and List.to_string/1 error path in Elixir

Published Aug 28, 2026
·
Updated

Uncontrolled Recursion vulnerability in the Elixir standard library allows an attacker who controls a list passed to inspect/1, List.tostring/1, or List.tocharlist/1 to exhaust a BEAM node's memory.

Inspect.List's charlist branch in lib/elixir/lib/inspect.ex classifies a list as a charlist using List.asciiprintable?/2, which examines only the first :printablelimit (4096 by default) elements, and then calls IO.chardatatostring/1 on the whole term. A list whose printable prefix exceeds that limit but which contains a later element that is not a code point (an atom, an out-of-range integer, or an improper tail) is therefore mis-classified, and the conversion raises ArgumentError. That conversion runs inside List.tostring/1, whose rescue clause builds its message by interpolating inspect(list), which re-enters the same branch and raises again. The nested inspection is an argument to raise, so the recursion is not in tail position and every level is retained: the process stack grows monotonically while each cycle re-walks the list, until the process is killed by maxheapsize or, by default, the node runs out of memory. List.tocharlist/1 has the same rescue shape.

Below the printable limit the inner inspect/1 sees the invalid element within its counter and renders the list in ordinary bracket form, so a single ArgumentError is raised and no recursion occurs.

This issue affects elixir: from 1.15.0-rc.0 before 1.18.5, from 1.19.0-rc.0 before 1.19.6, and from 1.20.0-rc.0 before 1.20.4.

Affected Software

1 affected component
Elixir Elixir>1.15.0-rc.0<=1.18.5, >1.19.0-rc.0<=1.19.6, >1.20.0-rc.0<=1.20.4

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 1.18.5
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 1.19.6
  3. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 1.20.4
  4. Compensating control

    Do not allow untrusted input to be passed to Elixir functions that trigger the vulnerable behavior: inspect/1, List.to_string/1, or List.to_charlist/1 (especially when the input is a list).

Event History

Aug 28, 2026
CVE Published
via MITRE·11:28 AM
Data Sourced
via MITRE·11:28 AM
DescriptionWeakness

Frequently Asked Questions

1

What input must an attacker control to trigger the recursion?

The attacker must control a list passed to one of the affected conversion or inspection paths. The list needs a printable prefix longer than the printable limit, followed by an invalid charlist element such as an atom, an out-of-range integer, or an improper tail.

2

Is the default configuration affected?

Yes. The default printable limit is 4096 elements, and classification examines only that prefix before attempting to convert the entire list. A malformed element after that limit can trigger the recursive error path.

3

What is the practical impact if exploitation succeeds?

Each recursive cycle retains stack growth and re-walks the supplied list, consuming memory. A process with max_heap_size may be killed; without that limit, the BEAM node can run out of memory.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203