CVE-2026-97853

Unbounded allocation in decimal Decimal.round/3 driven by the places argument enables DoS

Published Oct 10, 2026 CVSS 4.0 · 6.9 Medium EPSS < 1% KEV · Not listed
Description
Memory Allocation with Excessive Size Value vulnerability in ericmj decimal allows Denial of Service.

Decimal.round/3 builds the full result for the requested number of decimal places before the context precision (34 digits by default) is applied, so its cost grows with the places argument instead of with the size of the result. For positive places it appends places zero digits to the coefficient as a charlist before converting it to an integer, and for negative places it builds a charlist of -places zero digits. A single call such as Decimal.round(Decimal.new("1.5"), -50_000_000) allocates about 5.5 GB of memory, which can exhaust available memory and get the BEAM VM killed. The oldest releases instead loop once per decimal place, consuming CPU in proportion to places.

Any application that passes a user-supplied number of decimal places or scale to Decimal.round/2 or Decimal.round/3 without bounding it is exposed. The input limits added for CVE-2026-32686 do not cover the places argument.

This issue affects decimal: from 0.1.0 before 3.1.2.

Analysis

AI-generated

Technical impact

This vulnerability is an instance of uncontrolled memory allocation (CWE‑789). The function Decimal.round/3 constructs a character list of zero digits whose length equals the requested number of decimal places before converting the result to an integer. A maliciously large positive or negative places argument can cause the library to allocate gigabytes of memory, exhausting the BEAM virtual machine and terminating the application. The impact is a denial‑of‑service for any user that can influence the places argument.

Affected Systems

The affected library is ericmj decimal, a dependency of many Elixir projects. Versions from 0.1.0 up to and including 3.1.1 are vulnerable. The fix is present in 3.1.2 and later releases.

Risk and Exploitability

The CVSS score of 6.9 classifies this incident as high severity. No EPSS score is available and the vulnerability is not listed in the CISA KEV catalog, indicating no widespread exploitation has been observed to date. An attacker who can supply a large places value to Decimal.round/2 or Decimal.round/3 is able to trigger the allocation of several gigabytes of memory, which can force the BEAM VM to terminate. The feasibility of exploitation depends on whether the application exposes an interface that allows user input to determine the places argument; if such an interface exists, the risk is present.

Remediation

Vendor Workaround

Bound places before calling Decimal.round/2,3, for example to -34..34 or to the scales the application supports.


OpenCVE Recommended Actions

  • Upgrade ericmj decimal to version 3.1.2 or later.
  • If an upgrade is not possible, bound the places argument before calling Decimal.round, for example restrict it to the range –34 to 34 or to the scale values the application supports.
  • Validate all user‑supplied decimal scale inputs to ensure they fall within the specified safe range before invoking Decimal.round.

Generated by OpenCVE AI on October 10, 2026 at 22:35 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description Memory Allocation with Excessive Size Value vulnerability in ericmj decimal allows Denial of Service. Decimal.round/3 builds the full result for the requested number of decimal places before the context precision (34 digits by default) is applied, so its cost grows with the places argument instead of with the size of the result. For positive places it appends places zero digits to the coefficient as a charlist before converting it to an integer, and for negative places it builds a charlist of -places zero digits. A single call such as Decimal.round(Decimal.new("1.5"), -50_000_000) allocates about 5.5 GB of memory, which can exhaust available memory and get the BEAM VM killed. The oldest releases instead loop once per decimal place, consuming CPU in proportion to places. Any application that passes a user-supplied number of decimal places or scale to Decimal.round/2 or Decimal.round/3 without bounding it is exposed. The input limits added for CVE-2026-32686 do not cover the places argument. This issue affects decimal: from 0.1.0 before 3.1.2.
Title Unbounded allocation in decimal Decimal.round/3 driven by the places argument enables DoS
First Time appeared Ericmj
Ericmj decimal
Weaknesses CWE-789
CPEs cpe:2.3:a:ericmj:decimal:*:*:*:*:*:*:*:*
Vendors & Products Ericmj
Ericmj decimal
References
Metrics cvssV4_0

{'score': 6.9, 'vector': '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'}

Weaknesses
  • CWE-789

    Memory Allocation with Excessive Size Value

Sources

Status
PUBLISHED
Assigner
EEF
Published
Updated
Nov 19, 2026, 8:21 AM
Reserved
Oct 9, 2026, 12:30 AM
Status
Deferred
Published
Oct 10, 2026, 8:16 PM
Modified
Oct 15, 2026, 7:17 PM