DanielLeens commented on PR #11559:
URL: https://github.com/apache/seatunnel/pull/11559#issuecomment-6394093084

   Thanks @SEZ9. Kafka Gate follow-up at 
`5458405ede00c693da216f02c07908e4b11b11e7`, in response to 
https://github.com/apache/seatunnel/pull/11559#issuecomment-6393670258:
   
   1. **Exact names:** `KafkaGateObjectInputStream.resolveClass` still accepts 
only the exact existing names. There is no package/class prefix allowance.
   2. **Arrays (intentional stricter policy):** Kafka's decoder does **not** 
recursively allow arrays whose components are allowlisted. It retains the 
narrower pre-existing rule: only exact `[B` (`byte[]`) is allowed; *every other 
array descriptor*, including nested arrays and arrays of otherwise allowlisted 
classes, is rejected. I have not broadened the persisted input graph merely to 
match the dimension decoder. 
`productionDeserializeSplitShouldRejectArraysOutsideAllowlist` drives empty 
`HashMap[]`, `HashMap[][]`, `String[]` and `String[][]` through the real 
decoder and asserts the exact rejected descriptor. Empty arrays ensure the 
descriptor itself is checked, not only populated elements. Please confirm 
whether this stronger deny-by-default array policy satisfies the goal of your 
recursive-check request; I am not claiming recursive allowance was implemented.
   3. **Proxies:** added an explicit `resolveProxyClass` rejection before 
interface/handler resolution, guarded by 
`productionDeserializeSplitShouldRejectProxyClassesBeforeTheirHandler` with a 
benign serializable dynamic proxy and the exact exception assertion.
   4. **Other negative/positive coverage:** existing 
`productionDeserializeSplitShouldRejectClassOutsideAllowlist` (`HashMap`), 
`productionDeserializeSplitShouldRejectSamePackageSubclassOutsideAllowlist` 
(`KafkaSourceSplitState`), and 
`productionDeserializeSplitShouldRoundTripKafkaSourceSplit` remain. Staging 
round-trips now call the real production decoder too; their plain test-side 
ObjectInputStream helper was removed without dropping assertions.
   5. **No gate bypass:** source audit confirms `restoreGateState` verifies 
each split digest and calls `deserializeSplit` 
(KafkaSourceReader.java:238-246); `deserializeSplit` constructs only 
`KafkaGateObjectInputStream` (:404-407). There is no other ObjectInputStream 
construction in connector-kafka production sources. The class allowlist and new 
proxy override are at :431-461.
   
   Source: 
[KafkaSourceReader.java](https://github.com/DanielLeens/seatunnel/blob/5458405ede00c693da216f02c07908e4b11b11e7/seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/source/KafkaSourceReader.java#L398),
 
[KafkaSourceReaderGateTest.java](https://github.com/DanielLeens/seatunnel/blob/5458405ede00c693da216f02c07908e4b11b11e7/seatunnel-connectors-v2/connector-kafka/src/test/java/org/apache/seatunnel/connectors/seatunnel/kafka/source/KafkaSourceReaderGateTest.java#L184).
   
   Scoped Spotless apply/check and git diff checks passed. One independent 
agent's static patch review found no new code blocker. Per the local SeaTunnel 
validation boundary I did not run compile/UT/IT/E2E locally; GitHub CI on this 
exact head is still required. This is a fix follow-up, not a new formal review 
or a declaration that the finding/PR is approved.
   


-- 
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]

Reply via email to