{"id":"CVE-2026-97853","published":"2026-10-10T19:43:45Z","modified":"2026-11-19T08:21:37Z","title":"Unbounded allocation in decimal Decimal.round/3 driven by the places argument enables DoS","vendor":"ericmj","product":"decimal","tier":"tail","description":{"text":"Memory Allocation with Excessive Size Value vulnerability in ericmj decimal allows Denial of Service.\n\nDecimal.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.\n\nAny 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.\n\nThis issue affects decimal: from 0.1.0 before 3.1.2.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.9,"severity":"MEDIUM","version":"4.0","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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00138,"percentile":0.03256,"provenance":"source"},"cwes":[{"id":"CWE-789","name":"Memory Allocation with Excessive Size Value"}],"references":[{"url":"https://github.com/ericmj/decimal/security/advisories/GHSA-6c27-994x-c52f","tags":["vendor-advisory"]},{"url":"https://cna.erlef.org/cves/CVE-2026-97853.html","tags":["related"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-97853","tags":["related"]},{"url":"https://github.com/ericmj/decimal/commit/05bb73eb40ddef24eda782d905766f56a3660522","tags":["related"]},{"url":"https://github.com/ericmj/decimal/commit/338f42c8cf6a9749ab70c5af04734c6050ca3dc6","tags":["patch"]},{"url":"https://github.com/ericmj/decimal/commit/3c90af4c3c2dfa4bb4c138760a326dd0eb91822b","tags":["patch"]}],"priority":{"score":5.5,"factors":[{"name":"EPSS percentile","points":0.65},{"name":"CVSS severity","points":4.83}]},"vendorSlug":"ericmj","affectedVersions":[{"vendor":"ericmj","product":"decimal","versions":[">= 0.1.0, < 3.1.2"]},{"vendor":"ericmj","product":"decimal","versions":[">= 05bb73eb40ddef24eda782d905766f56a3660522"]}],"fixedVersions":[{"vendor":"ericmj","product":"decimal","versions":["338f42c8cf6a9749ab70c5af04734c6050ca3dc6","3c90af4c3c2dfa4bb4c138760a326dd0eb91822b"]}],"workarounds":{"items":["Bound places before calling Decimal.round/2,3, for example to -34..34 or to the scales the application supports."],"from":"CVE.org CNA","provenance":"source"},"capec":[{"id":"CAPEC-130","name":"An attacker who controls the number of decimal places an application rounds to makes one Decimal.round/2,3 call allocate memory in proportion to that number. A value of 50 million needs about 5.5 GB, enough to get the BEAM VM killed on hosts with less memory and take down every request it serves."}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2026-10-15T17:51:21.251991Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2026-96426","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-ericmj-decimal-cve-2026-32686","parents":[{"from":"CVE-2026-32686","to":"CVE-2026-97853","relation":"incomplete-fix","confidence":"high","kind":"lineage","evidence":[{"kind":"text","provenance":"source","relation":"incomplete-fix","quote":"The input limits added for CVE-2026-32686 do not cover the places argument.","from":"CVE.org","in":"CVE-2026-97853"},{"kind":"same-code","provenance":"machine","files":["lib/decimal.ex"],"commits":["https://github.com/ericmj/decimal/commit/bc11f4a2b6fb61fc1360a0ab4e79141bba918841","https://github.com/ericmj/decimal/commit/6a523f3a73b8c9974540e21c7aa88f1258bb35ae","https://github.com/ericmj/decimal/commit/05bb73eb40ddef24eda782d905766f56a3660522","https://github.com/ericmj/decimal/commit/338f42c8cf6a9749ab70c5af04734c6050ca3dc6"],"basis":"rarely changed file"}]}]}}