Unbounded integer parsing in the Version module enables CPU and memory exhaustion denial of service
elixir-lang elixir
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| elixir-lang elixir |
| No fix yet |
| elixir-lang elixir |
| No fix yet |
Original description
Uncontrolled Resource Consumption vulnerability in the Elixir standard library's Version module allows an attacker who controls a version string to cause a denial of service through CPU and memory exhaustion.
The version parser converts numeric version components (major, minor, patch and numeric pre-release/build identifiers) to integers without bounding their length. A single large all-digit component therefore forces a super-linear, non-yielding base-10 to arbitrary-precision integer conversion (String.to_integer/1, i.e. :erlang.binary_to_integer/1) that pins a BEAM scheduler, and a larger component raises an uncaught SystemLimitError that crashes the calling process. A single moderately sized string (around one megabyte) is enough; no authentication is required.