[
https://issues.apache.org/jira/browse/KYLIN-6092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18109815#comment-18109815
]
ASF subversion and git services commented on KYLIN-6092:
--------------------------------------------------------
Commit bedcc2fa3afb306d0ea58c88660c7265840fa3dc in kylin's branch
refs/heads/kylin5 from jlfsdtc
[ https://gitbox.apache.org/repos/asf?p=kylin.git;h=bedcc2fa3a ]
KYLIN-6092 Add polymorphic type validator for secure JSON deserialization
* KYLIN-6092 Add polymorphic type validator to restrict classes loadable during
JSON deserialization
Event, SegmentRange and BroadcastEventReadyNotifier use
@JsonTypeInfo(Id.CLASS), which lets an attacker-supplied @class id load
arbitrary classes (deserialization gadget attack). Set a
BasicPolymorphicTypeValidator that only allows org.apache.kylin.*
subtypes on the JsonUtil mappers and on the Spring HTTP converter
ObjectMapper in AppConfig.
Co-Authored-By: Claude Fable 5 <[email protected]>
* KYLIN-6092 Fix flaky UT and ignore test-generated files
- BaseSchedulerTest: stop the scheduler and wait for JobWorker threads to
unwind before cleanup, so a lingering worker does not steal driver memory
from the next test's baseline (ResourceAcquirer's semaphore is static).
- KylinConfigBaseTest: compare ext jar paths order-insensitively.
- .gitignore: exclude UT temp files and generated query result artifacts.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
* KYLIN-6092 Replace ad-hoc ObjectMapper instances with JsonUtil
Route JSON reads/writes through JsonUtil so they inherit the shared
polymorphic type validator instead of using raw ObjectMapper instances.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
* KYLIN-6092 Build JsonUtil object mappers via JsonMapper.builder
Replace the static initializer block with builder-based field
initializers. The active serialization view still has to be applied on
the built mapper, since MapperBuilder exposes no setter for it.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
---------
Co-authored-by: Claude Fable 5 <[email protected]>
> Insecure Jackson deserialization
> --------------------------------
>
> Key: KYLIN-6092
> URL: https://issues.apache.org/jira/browse/KYLIN-6092
> Project: Kylin
> Issue Type: Task
> Reporter: PJ Fanning
> Assignee: Longfei Jiang
> Priority: Major
>
> [https://github.com/apache/kylin/blob/b5b94b51abaf83d68088e4fcab606d2a6530e54d/src/core-common/src/main/java/org/apache/kylin/common/persistence/event/Event.java#L33]
> `@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS)` – when you deserialize the
> `@class` value that appears in the JSON can be any class name and Jackson
> will load that class and try to create an instance.
> You should add a polymorphic type validator to your ObjectMapper that
> restricts which classes can be loaded at deserialization time.
> https://fasterxml.github.io/jackson-databind/javadoc/2.10/com/fasterxml/jackson/databind/jsontype/BasicPolymorphicTypeValidator.html
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)