CPP-Ethereum JSON-RPC admin_addPeer Authorization Bypass Vulnerability
The admin_addPeer JSON-RPC method in cpp-ethereum lacked the administrator privilege check that other admin methods enforce, so any remote client could call it without credentials. An attacker could send a JSON request to add a peer to the node, reaching functionality reserved for administrators.
Originally disclosed on Cisco Talos
An exploitable improper authorization vulnerability exists in adminaddPeer API of cpp-ethereum’s JSON-RPC (commit 4e1015743b95821849d001618a7ce82c7c073768). A JSON request can cause an access to the restricted functionality resulting in authorization bypass.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The admin_addPeer handler omitted the RPC_ADMIN privilege check that comparable admin methods perform before acting.
Impact
An unauthenticated remote attacker could invoke administrator-only peer management; the text notes the admin interface is off by default, but when enabled it binds to all interfaces and does not enforce the JSON content type, so requests could also be triggered via CSRF or SSRF.
What the attacker needed
Admin interface enabled; network access to the RPC port; no credentials needed
The fix
The handler should perform the same administrator privilege check as the other admin methods before adding a peer.
How it was found
- Start the eth client with the admin interface exposed over HTTP.
- Confirm the JSON-RPC service is listening on all interfaces.
- From another host, send a JSON request calling the admin_addPeer method.
- Observe the node accept the request and return peer information without any credential check.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A node is a program that participates in the Ethereum network. It offers a small web service (JSON-RPC) so other programs can ask it to do things. Some of those actions are meant only for the administrator, and the program is supposed to check who is asking. Here one action skipped that check, so anyone who could reach the service could use it.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.