KAFKA-20822: Harden Trogdor polymorphic JSON deserialization - #22936
Open
lh0156 wants to merge 1 commit into
Open
KAFKA-20822: Harden Trogdor polymorphic JSON deserialization#22936lh0156 wants to merge 1 commit into
lh0156 wants to merge 1 commit into
Conversation
Generated-by: OpenAI Codex (GPT-5)
lh0156
force-pushed
the
agent/KAFKA-20822-harden-trogdor-json
branch
from
August 2, 2026 13:16
1912c18 to
2ea02cf
Compare
Author
|
Rebased this PR onto the latest trunk and added the Kafka-required AI contribution trailer to the commit ( Independent verification on the rebased commit:
|
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.
Fixes KAFKA-20822.
Summary
BasicPolymorphicTypeValidator.TaskSpecimplementations from thetask,fault, andworkloadpackages.TaskSpecsubtypes are rejected while built-in types from each supported package remain readable.Why
TaskSpecuses JacksonJsonTypeInfo.Id.CLASS, which previously allowed any class on the classpath that extendedTaskSpecto be selected by the incomingclasstype id. The allowlist preserves the existing wire format and built-in task types while preventing external subtypes from being instantiated.Verification
./gradlew :trogdor:test --tests org.apache.kafka.trogdor.task.TaskSpecTest --no-build-cache./gradlew :trogdor:test --no-build-cache./gradlew :trogdor:spotlessCheck :trogdor:checkstyleMain :trogdor:checkstyleTest :trogdor:spotbugsMain --no-build-cachegit diff --checkNo public JSON shape or built-in Trogdor task behavior is changed.