Repository navigation
Conversation
|
@zkaoudi Pr is up for your review. |
|
Thanks for the fix. Three issues to address before merging:
Reproduced all three on Java 17. Please tighten the allowlist and add regression tests. |
05351a2 to
c2850f7
Compare
|
@novatechflow Updated the allowlist and WayangValue as per the feedback. Alos added regression tests for all three cases in |
Immutable collections now round-trip correctly, and deserialization failures propagate instead of silently returning null. Great work! |
c2850f7 to
91bacd7
Compare
|
@novatechflow Updated the PR and added the following : |
|
Took a bit longer to check and write a proper review since its sec relevant, three blockers still reproduced with Java 17:
|
What changes?
ObjectFileSerialization:createObjectInputFilter(Class<?> elementType)to restrict legacy object deserialization to expected primitives, wrappers, standard safe collections, Wayang types, Scala tuples, and expectedelementTypehierarchies.wayang.basic.serialization.allowlist.InvalidClassException.WayangValue:ObjectInputFilteron Flink criterion deserialization.convertToByteandconvertToObjectto use try-with-resources.elementTypeacceptance, and system property pattern matching.Why are the changes needed?
Directly calling
ObjectInputStream.readObject()without anObjectInputFilterallows arbitrary class instantiation, posing a deserialization security risk (CWE-502).How was this tested?
ObjectFileSerializationTestandWayangValueTest.mvn testonwayang-basicandwayang-flink.mvn apache-rat:check.Closes : #835