Skip to content

fix: avoid loading peer-supplied exception classes - #1296

Merged
kabir merged 1 commit into
a2aproject:mainfrom
kabir:fix-compat03-throwable-deserialization
Nov 5, 2026
Merged

kabir merged 1 commit into
a2aproject:mainfrom
kabir:fix-compat03-throwable-deserialization

Conversation

@kabir

@kabir kabir commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Description

The v0.3 JSON-RPC error deserializer loads the class named in error data and may invoke its constructor. Return a generic RuntimeException with the supplied message instead, while keeping the serialized format unchanged. This changes the Java exception subtype callers see in error data.

Add regression tests covering class initialization and exception construction. Based on a fix proposed by Chaitanya Pawar.

Testing

  • mvn -pl compat-0.3/client/transport/jsonrpc -am test

Use a generic exception when reading v0.3 JSON-RPC error data. Add regression coverage for class initialization and constructor invocation. Based on a fix and test proposed by Chaitanya Pawar.

@Chaitanya-Pawar8 Chaitanya-Pawar8 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — the fix correctly removes Class.forName from the read path. The two regression tests (non-Throwable init + Throwable instantiation) are clean and comprehensive. The Javadoc update is accurate.

Thanks for the quick turnaround!

@kabir
kabir merged commit 5811345 into a2aproject:main Nov 5, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants