damansingh1313 commented on issue #17802:
URL: https://github.com/apache/iceberg/issues/17802#issuecomment-5442761763

   Hi @RussellSpitzer — I'd like to work on this if it's still open.
   
   I traced every production caller of AvroEncoderUtil.encode to see what the 
legitimate class set actually looks like, and it's small and enumerable rather 
than open-ended: ManifestFiles.encode(GenericManifestFile) in core, and 
AvroUtil.encode(Event) in kafka-connect — which already has a hardcoded 
allowlist for this exact purpose (FIELD_ID_TO_CLASS).
   
   My plan: gate GenericAvroReader.recordReader's "resolve a real class and 
construct it" branch behind an explicit allowlist passed in from each decode 
call site (reusing FIELD_ID_TO_CLASS for kafka-connect, and just 
GenericManifestFile for core's ManifestFiles.decode). Anything not on that list 
falls through to the existing generic ValueReaders.record(...) path — the one 
that already runs today whenever a name doesn't resolve to a loadable class — 
instead of ever attempting Class.forName on an arbitrary schema-supplied name.
   
   Want to confirm I'm not missing another legitimate caller before I start. 
Happy to open a PR with tests covering both the allowlisted and non-allowlisted 
paths once I've got something working.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to