Skip to content

proposal: x/exp/jsonrpc2: allow JSON-RPC2 response errors to be exploitable #56133

Open
@maxatome

Description

@maxatome

jsonrpc2.wireError type is not exported, but contains useful information.

As jsonrpc2.AsyncCall.Await() returns an error, when a JSON-RPC2 error is returned by the server side, it is not possible for the caller to guess it is really a server error and also to access data it contains.

The proposal is simply to rename jsonrpc2.wireError to jsonrpc2.Error as done in https://go-review.googlesource.com/c/exp/+/415615

This way the caller can do a type assertion to check it is a server error, and then access the already exported fields.

The backward compatibility is not broken as the previous jsonrpc2.wireError type was not exported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Incoming

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions