oscerd opened a new pull request, #24134: URL: https://github.com/apache/camel/pull/24134
Enables `MapperFeature.BLOCK_UNSAFE_POLYMORPHIC_BASE_TYPES` by default on the `camel-jackson` data format's `ObjectMapper`. `JacksonDataFormat.createNewObjectMapper()` previously built a bare `new ObjectMapper()` without this guard, while the sibling `transform/Json.java` already enables it. Users who turn on polymorphic / default typing (via `enableFeatures` / `moduleClassNames`) were exposed to gadget-chain deserialization on untrusted input. ## Changes - `createNewObjectMapper()` now builds the mapper via `JsonMapper.builder().enable(MapperFeature.BLOCK_UNSAFE_POLYMORPHIC_BASE_TYPES).build()` (non-deprecated, mirrors `transform/Json.java`). - New `JacksonDataFormatPolymorphicHardeningTest` asserts the feature is enabled on the data format's default mapper. - Upgrade-guide note (potential breaking change for routes that enable polymorphic / default typing on an unsafe base type; opt out via a custom `ObjectMapper`). ## Notes - All existing camel-jackson tests pass (101); ordinary marshalling / unmarshalling is unaffected — the guard only blocks unsafe base types (`Object`, `Serializable`, `Comparable`) under polymorphic / default typing. - No `@UriParam` / metadata change, so no catalog / DSL regeneration. Full `mvn clean install -DskipTests` reactor build is green. Jira: https://issues.apache.org/jira/browse/CAMEL-23786 _Claude Code on behalf of Andrea Cosentino_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
