-
Notifications
You must be signed in to change notification settings - Fork 7
OOM on some BigDecimal inputs during serialization #29
Comments
It seems that using of
But even in case of using of
So, we should avoid returning of parsed BigDecimal with too big exponent or with MathContext.UNLIMITED. As example to mitigate possible DoS attacks jsoniter-scala uses safe defaults that limit a scale value and number of significant digits. Also, it sets |
@plokhotnyuk I think safe or unsafe to use is out of scope for a serializer. I believe any valid value of any supported type should be reversely serializable without loosing data, that is:
Using |
@migesok so will there be a pull request ? :) |
@t3hnar what about changing the representation from textual to binary? As example, will it be acceptable if In any case, the value of |
@plokhotnyuk why not? it is a binary format at the end. |
For a serializer generated for a case class which contains a BigDecimal field, if a number with sufficiently big scale supplied (like
BigDecimal("3E1000000000")
), serialization logic blows in memory causing OOM.This could be a possible source for DoS attacks.
The text was updated successfully, but these errors were encountered: