-
-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor scala number deserialization (BigDecimal/BigInt) #572
Comments
You can get much safe and more efficient parsing of |
Thanks @plokhotnyuk - your BigDecimal parser code is worth looking at. I guess it would be more advantageous to Jackson users to port it to Java and use it in jackson-core. That lib has a BigDecimalParser but it only has the special case that your code has for handling numbers with a lot of digits (more than 500 in jackson-core code). Is your Scala code based on eobermuhlner/big-math like jackson-core's code is? |
Yes, but also adding limits for mantissa length, scale, and math context too avoid vulnerabilities on subsequent (after parsing) operations, like those that was described here. |
Thanks @plokhotnyuk - v2.14 is due out soon so I don't want to delay it by taking on new items - I'll look at this for v2.15. There might be scope in v2.14 to DoS cases. Would you be able to provide a couple of example numbers I could test? If you think such values are sensitive (that you don't want to provide ammo for malicious actors), you can DM me at https://www.linkedin.com/in/pj-fanning/ |
Most of possible Below are results for different mantissa sizes:
For getting them the following config for macros was used: |
@plokhotnyuk I'm experimenting with porting some of your code to Java. One thing that confuses me is the use of the |
Yes, It is a small reusable array of |
2.14.0-rc1 is out |
The text was updated successfully, but these errors were encountered: