CAMEL-23803: block unsafe polymorphic base types by default in camel-jackson-avro and camel-jackson-protobuf (backport to 4.14.x)#24198
Merged
oscerd merged 1 commit intoJun 24, 2026
Conversation
…jackson-avro and camel-jackson-protobuf (backport to 4.14.x) The camel-jackson-avro and camel-jackson-protobuf data formats now create their default AvroMapper / ProtobufMapper with MapperFeature.BLOCK_UNSAFE_POLYMORPHIC_BASE_TYPES enabled, mirroring the hardening applied to camel-jackson (CAMEL-23786) and camel-jacksonxml (CAMEL-23787) and to their respective transform/ mappers. This is defense-in-depth against gadget-chain deserialization: when polymorphic / default typing is enabled, Jackson refuses unsafe base types (Object, Serializable, Comparable). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
davsclaus
approved these changes
Jun 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #24195 to
camel-4.14.x.camel-jackson-avro's andcamel-jackson-protobuf'screateNewObjectMapper()now build their defaultAvroMapper/ProtobufMapperwithMapperFeature.BLOCK_UNSAFE_POLYMORPHIC_BASE_TYPESenabled, mirroring the hardening applied tocamel-jackson(CAMEL-23786) andcamel-jacksonxml(CAMEL-23787) and to their respectivetransform/mappers. Defense-in-depth against gadget-chain deserialization; ordinary marshalling/unmarshalling is unchanged. Opt out via theobjectMapperoption.Code + test only — the upgrade-guide entry lives on
main(per the docs-on-main policy).AI-generated by Claude Code on behalf of Andrea Cosentino.