Performance issue with malicious `BigDecimal` input, `InstantDeserializer`, `DurationDeserializer` (CVE-2018-1000873)
See original GitHub issue(note: moved from https://github.com/FasterXML/jackson-databind/issues/2141 reported by @plokhotnyuk)
It looks the same as: https://github.com/playframework/play-json/issues/180
Reproduced by the following commit: https://github.com/plokhotnyuk/jsoniter-scala/pull/153/commits/0d53faf5093b492867b550f2cec55ff0b5cc62de
The security bug is in InstantDeserializer
and DurationDeserializer
of the jackson-datatype-jsr310
artifact:
protected T _fromDecimal(DeserializationContext context, BigDecimal value)
{
long seconds = value.longValue(); // <- hangs in case of 10000000e100000000
int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds);
return fromNanoseconds.apply(new FromDecimalArguments(
seconds, nanoseconds, getZone(context)));
}
W/A is to use custom serializers for all types that are parsed with InstantDeserializer
and DurationDeserializer
by registering them after (or instead of) registration of the JavaTimeModule
module.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fixed via #87, to be included in 2.9.8 and later.
@datagitlies No plans to backport as I really want to close 2.8 branch and any time spent on releasing from pre-2.9 is away from limited amount of time I have for my OSS hobby. In this case patch would need to involve multiple components, for general DoS protection (
jackson-core
andjackson-databind
have some, as well as this module). So, I appreciate your offer to help, but I don’t think I want to work on backport here.