Repository navigation
v3.1.2
Security
-
Fix
Decimal.round/3building its result at the full requested scale
before applying the context precision, so its time and memory grew with
theplacesargument instead of with the precision. A caller controlling
placescould exhaust memory with one call:
Decimal.round(Decimal.new("1.5"), -50_000_000)allocated about 5.5 GB,
and positiveplacesabove about 1.26 million built the padding and then
raisedSystemLimitError. The coefficient is now padded to at most one
digit past the context precision, and dropping more digits than the
coefficient has no longer builds a list of zeros of that length. Results
and flags are unchanged, except that those calls now return a value. This
is a fix for CVE-2026-97853 (GitHub advisory
GHSA-6c27-994x-c52f). -
Make
Decimal.to_integer/1andDecimal.to_float/1return0and0.0
for a zero coefficient without computing a power of ten the size of its
exponent. Zeros are exempt from the exponent limits, soDecimal.round/3
returns zeros such as0E+1000000000for largeplaces, and converting
one spent about 1.8 seconds before raisingSystemLimitError. This is part
of the fix for CVE-2026-97853 (GitHub advisory
GHSA-6c27-994x-c52f).