Unbounded allocation in decimal Decimal.round/3 driven by the places argument enables DoS
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.
CVE-2026-97853
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: cve:CVE-2026-97853
decimal
Source reference: /containers/cna/affected/0/product
- Affected versions
- Not stated in this record
- Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
decimal
Source reference: /containers/cna/affected/1/product
- Affected versions
- Not stated in this record
- Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"cpes": [
"cpe:2.3:a:ericmj:decimal:*:*:*:*:*:*:*:*"
],
"repo": "https://github.com/ericmj/decimal",
"vendor": "ericmj",
"modules": [
"'Elixir.Decimal'"
],
"product": "decimal",
"versions": [
{
"status": "affected",
"version": "0.1.0",
"lessThan": "3.1.2",
"versionType": "semver"
}
],
"packageURL": "pkg:hex/decimal",
"packageName": "decimal",
"programFiles": [
"lib/decimal.ex"
],
"collectionURL": "https://repo.hex.pm",
"defaultStatus": "unaffected",
"programRoutines": [
{
"name": "'Elixir.Decimal':round/2"
},
{
"name": "'Elixir.Decimal':round/3"
}
]
},
{
"cpes": [
"cpe:2.3:a:ericmj:decimal:*:*:*:*:*:*:*:*"
],
"repo": "https://github.com/ericmj/decimal",
"vendor": "ericmj",
"modules": [
"'Elixir.Decimal'"
],
"product": "decimal",
"versions": [
{
"status": "affected",
"changes": [
{
"at": "338f42c8cf6a9749ab70c5af04734c6050ca3dc6",
"status": "unaffected"
},
{
"at": "3c90af4c3c2dfa4bb4c138760a326dd0eb91822b",
"status": "unaffected"
}
],
"version": "05bb73eb40ddef24eda782d905766f56a3660522",
"lessThan": "*",
"versionType": "git"
}
],
"packageURL": "pkg:github/ericmj/decimal",
"packageName": "ericmj/decimal",
"programFiles": [
"lib/decimal.ex"
],
"collectionURL": "https://github.com",
"defaultStatus": "unaffected",
"programRoutines": [
{
"name": "'Elixir.Decimal':round/2"
},
{
"name": "'Elixir.Decimal':round/3"
}
]
}
]- Related CVEs
- CVE-2026-97853
Source reference:
/cveMetadata/cveId
Publisher severity
medium
Source reference: /containers/cna/metrics
- Event
- #30018 · Revision 1
- Added to Heist Feed
- Publisher date