ppkarwasz opened a new pull request, #4466: URL: https://github.com/apache/logging-log4j2/pull/4466
> [!IMPORTANT] > This PR is part of the deserialization hardening work tracked in #4168. The Logging Services PMC does **not** use nor recommend Java serialization/deserialization, and [our security FAQ](https://logging.apache.org/security/faq.html#deserialization) has long documented this position. This work is submitted solely to reduce the false-positive "vulnerability" reports that keep being filed regardless of that FAQ. Its utility for end users is close to zero. Backports the following PRs from `2.x` to `2.25.x`, one cherry-picked commit (`-x`) per PR: - #4365: Apply the outer `ObjectInputFilter` to nested streams - #4269: Reject dynamic proxies in `FilteredObjectInputStream` - #4270: Apply the deserialization filter in test helpers on Java 9+ - #4271: Serialize the `LogEvent` message without `MarshalledObject` - #4272: Simplify the serialization of `SortedArrayStringMap` - #4274: Simplify the serialization of `ObjectArrayMessage` and `ParameterizedMessage` ## Differences from `2.x` - **No deprecation:** `FilteredObjectInputStream` gets the new Javadoc from #4365, but is **not** marked `@Deprecated` on `2.25.x`. The corresponding `deprecated` changelog entry is dropped. - **No package version bumps:** the new public members of the published test helpers (`SerialUtil` and `SerializableMatchers` overloads, `UnserializableMessage`, `Tags.SERIALIZATION`) are annotated with `@BaselineIgnore("2.25.6")` instead. - **#4098 is not on `2.25.x`:** the `assertFiltered` calls removed by #4365 only existed in `ObjectMessage`, `ParameterizedMessage` and `SortedArrayStringMap`; the `util.internal` `package-info.java` is not added. From the test helpers of #4270 only what the backported tests need was taken; in `log4j-core-test/pom.xml` only the `test-serial-filter` execution is added. ## Compatibility As on `2.x`, the serialized forms of `Log4jLogEvent`, `SortedArrayStringMap`, `ObjectArrayMessage` and `ParameterizedMessage` change, and their `serialVersionUID`s are changed: data serialized by `2.25.5` or earlier cannot be deserialized by this version and vice versa. ## Testing `./mvnw install` of `log4j-api-java9`, `log4j-api`, `log4j-api-test`, `log4j-core-java9`, `log4j-core`, `log4j-core-test` and `log4j-1.2-api` on JDK 17: all tests pass (including the `test-serial-filter` execution) and the bnd baseline checks succeed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
