AliRana30 commented on PR #838: URL: https://github.com/apache/wayang/pull/838#issuecomment-6836291448
Thanks @novatechflow and @Kaileshwar16 for the review! Pushed a follow-up commit fixing all points: 1. **No stream-selected class trust (`WayangValue`):** Removed the stream type-name header (`write()`/`read()` back to `[varint len][payload]`), so `WayangValue.read()` never loads or trusts stream-supplied classes. Expected custom types now come only from the declared `Class<T>` (`WayangValue(Class<T>)` / `setType`), trusted config (`wayang.flink.value.expected-type` or `wayang.basic.serialization.expected-type`), or configured allowlists (`wayang.basic.serialization.allowlist` / `wayang.flink.serialization.allowlist`) via system properties or Wayang `Configuration`. 2. **`Object` / `List` support:** Removed the `Serializable` assignable check in `WayangValue.read()`. `Object.class` and `List.class` (`ArrayList`, `Arrays.asList`, `List.of`) payloads deserialize cleanly with `targetType.isInstance(result)` validation, while non-allowlisted custom subclasses with hooks remain rejected. 3. **Resource limits & bounds:** `ObjectFileSerialization.createObjectInputFilter` enforces `depth` (`100`), `arrayLength` (`1_048_576`), `references` (`100_000`), and `streamBytes` (`67_108_864`) before `serialClass() == null` returns `UNDECIDED` (overridable via `wayang.basic.serialization.max-*`). `WayangValue.read()` also validates varint lengths against `[0, maxBytes]` before allocating. 4. **Java 17 regression tests:** Added coverage in `ObjectFileSerializationTest` (19/19) and `WayangValueTest` (13/13) for stream-hook rejection, `Object`/`List` payloads and mismatches, trusted config/allowlist resolution, and resource limits (`wayang-basic` 33/33 passed; `wayang-flink` 37 passed, 1 pre-existing skip in `FlinkGlobalReduceOperatorTest`; `apache-rat:check` passed). -- 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]
