Skip to content

KYLIN-6092 Add polymorphic type validator for secure JSON deserialization - #2354

Open
jlfsdtc wants to merge 1 commit into
apache:kylin5from
jlfsdtc:KYLIN-6092
Open

KYLIN-6092 Add polymorphic type validator for secure JSON deserialization#2354
jlfsdtc wants to merge 1 commit into
apache:kylin5from
jlfsdtc:KYLIN-6092

Conversation

@jlfsdtc

@jlfsdtc jlfsdtc commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

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.

…e 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 <noreply@anthropic.com>
@pjfanning

Copy link
Copy Markdown
Member

Change looks promising.
There are other places where new ObjectMappers are created. Are we sure that the changes in this PR are the only ones that need the PolymorphicTypeValidator?

https://github.com/search?q=repo%3Aapache%2Fkylin+new+ObjectMapper&type=code

Not all of the mappers in the search results are test cases.

@jlfsdtc

jlfsdtc commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

You right. I will replace ObjectMappe with JsonUtil later for standardize usage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants