FasterXML / jackson-dataformats-binary

Uber-project for standard Jackson binary format backends: avro, cbor, ion, protobuf, smile
Apache License 2.0
310 stars 133 forks source link

Add unit test for too deep nesting check for Avro read #367

Closed cowtowncoder closed 1 year ago

cowtowncoder commented 1 year ago

@pjfanning Adding test for nesting check wrt Avro -- had to use lower nesting since Avro generator can't write 1500 levels due to StackOverflow :)

I think similar thing would work for Protobuf too.

pjfanning commented 1 year ago

@cowtowncoder should we lower the default limit on StreamReadConstraints - to 200, maybe?

Otherwise, we'll need to document that Avro users should explicitly set the 200 limit themselves.

cowtowncoder commented 1 year ago

Not on account of my test: the problem was on generation side, not decoding. (although maybe worth considering for generation-side limits once we get there...)

But if we could establish that Avro decoding has lower maximum then we probably should consider that. Until then I think it's useful to keep maximum settings the same across formats.