The GitHub Actions job "Nightly Builds (1.7)" on pekko.git/main has failed.
Run started by GitHub user pjfanning (triggered by pjfanning).

Head commit for run:
3def3978a79e3a07db2703d40a0c0ac1789752ee / PJ Fanning 
<[email protected]>
fix: bound nesting depth when deserializing enclosed payloads (#3500)

Motivation:
Several of the remoting wire formats enclose a serialized payload whose enclosed
message is itself a serialized payload (for example Some, Optional, 
Status.Failure,
StatusReply, a Throwable cause, or an ActorSelectionMessage). Each level is 
parsed
separately, so neither a protobuf parser's own nesting limit nor the size of the
message bounds how deep the chain can go relative to the stack: the recursion 
tracks
the nesting rather than the number of bytes. A sufficiently deeply nested 
message
fails with a StackOverflowError rather than a serialization error.

Modification:
Add a per-thread nesting-depth counter (NestedDeserialization). A level is 
counted
where a serializer is actually invoked: Serialization.deserializeByteArray 
counts
one, and in WrappedPayloadSupport.deserializePayload the two branches that call 
a
serializer directly count one each, while the branch that delegates back to
Serialization leaves the counting to it. Nesting deeper than
pekko.actor.serialization-max-nesting-depth (default 32) is rejected with a
NotSerializableException. Ordinary nesting depths are unaffected.

Result:
An over-nested payload is rejected as an ordinary serialization error instead of
exhausting the stack.

Tests:
- sbt "remote/testOnly 
org.apache.pekko.remote.serialization.NestedPayloadDepthSpec" - 5 passed
- sbt "actor-tests/testOnly org.apache.pekko.serialization.SerializeSpec 
org.apache.pekko.serialization.WireManifestClassLoadingSpec" - 21 passed
- sbt "actor/mimaReportBinaryIssues" "remote/mimaReportBinaryIssues" - no issues
- scalafmt on the changed Scala sources

References:
None - robustness of nested payload deserialization

Report URL: https://github.com/apache/pekko/actions/runs/33577068601

With regards,
GitHub Actions via GitBox


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

Reply via email to