Skip to content

jsonrpc: add a batch size limit for RPC requests #2867

Closed

Description

@cason

Our homemade RPC implementation, jsonrpc, allows users to invoke multiple RCP methods using a single request, using batching. While this is not a problem, it may constitute a form of attack vector.

By investigating the code, batching is implemented by this method:

// first try to unmarshal the incoming request as an array of RPC requests

Not sure if this is the only method implementing batched requests, but this one was identified by running a test client.

We should consider adding a configuration parameter to limit the size/length of batched RPC requests submitted to Comet. To preserve backwards compatibility, the default value for this parameter can be 0, meaning no limit.

Activity

  1. ValarDragon commented on Apr 22, 2024

    @ValarDragon
    Contributor

    I'm very supportive of doing this w/ a config option!

  2. added this to the 2024-Q2 milestone on Apr 22, 2024
  3. self-assigned this
    on Apr 23, 2024
  4. andynog commented on Apr 24, 2024

    @andynog
    Contributor

    I'll look into this and try to push a PR in the next couple of days

  5. moved this from Todo to In Progress in CometBFTon Apr 25, 2024
  6. 5 remaining items

  7. moved this from In Progress to Ready for Review in CometBFTon May 1, 2024
  8. added a commit that references this issue on May 2, 2024
    aa1caba
  9. moved this from Ready for Review to Done in CometBFTon May 2, 2024
  10. added 2 commits that reference this issue on May 2, 2024
    62ddf31
    ef93acc
  11. added 2 commits that reference this issue on May 3, 2024
    bce83b3
    6f2fc74
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions