fix: restrict json rpc public methods#4921
Conversation
- add a read-only allowlist for the /rpc aggregate endpoint - block state-changing RPC methods such as submitProof createProposal and vote - add regressions for denied writes allowed reads and malformed params
|
Welcome to RustChain! Thanks for your first pull request. Before we review, please make sure:
Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150) A maintainer will review your PR soon. Thanks for contributing! |
|
Checklist note: I do not have permission to apply repository labels from this fork. This is a JSON-RPC dispatch hardening fix for #4601; I would classify it as BCOS-L1 or BCOS-L2 depending on maintainer severity policy. Local validation and BCOS SPDX check are listed in the PR body. Payout wallet / miner ID: |
shuibui
left a comment
There was a problem hiding this comment.
Code Review: Approve
Good fix.
**Verdict: Approve.
shuibui
left a comment
There was a problem hiding this comment.
Code Review: Approve
Good fix.
**Verdict: Approve.
shuibui
left a comment
There was a problem hiding this comment.
Code Review: Approve
Good fix.
**Verdict: Approve.
shuibui
left a comment
There was a problem hiding this comment.
Code Review: Approve
Good fix.
**Verdict: Approve.
shuibui
left a comment
There was a problem hiding this comment.
Code Review: Approve
Good fix.
**Verdict: Approve.
shuibui
left a comment
There was a problem hiding this comment.
Code Review: Approve
Good fix.
**Verdict: Approve.
shuibui
left a comment
There was a problem hiding this comment.
Code Review: Approve
Good fix.
**Verdict: Approve.
shuibui
left a comment
There was a problem hiding this comment.
Code Review: Approve
Good fix.
**Verdict: Approve.
Summary
/rpcendpointsubmitProof,createProposal, andvotefrom being invoked through/rpcparamsbefore dispatchTests
git diff --check origin/main...HEADpython3 -m py_compile rips/rustchain-core/api/rpc.py tests/test_json_rpc_method_whitelist.pyPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --no-project --with pytest --with flask python -m pytest tests/test_json_rpc_method_whitelist.py -q-> 3 passedpython3 tools/bcos_spdx_check.py --base-ref origin/main-> OKNo live node or production RPC service was used.