Closed
Description
It can lead for security problems in open systems, which use these operators without checking of scale of received BigDecimal values.
Following code can grab CPU core for several minutes and then will throw an out of memory error:
BigDecimal("1e1000000000", java.math.MathContext.DECIMAL128) + 1
W/A is using of methods of underlying java.math.BigDecimal, like:
BigDecimal("1e1000000000").underlying.add(BigDecimal("1").underlying, java.math.MathContext.DECIMAL128)