Dependency on Docker ports allows highjack of HTTP API
Title: Dependency on Docker ports allows highjack of HTTP API By: @txcrypto
Details: Summary: If 'docker up' is run and the port needed for keosd is already taken it just fails silently and the rest of the HTTP API works except wallet related calls.
Description: [add more details about this vulnerability] Bind for 0.0.0.0:9876 failed: port is already allocated shows as an error message since the port is already taken. The problem is the rest of the blockchain runs fine and is producing blocks. All http calls work except wallet specific calls.
The risk is: If a docker instance which could be a copy of keosd with the addition of a data logger is already running on that port it would interact normally with the blockchain after docker up is run putting keys generated from create wallet at risk.
Product Version: 1.0
git commit hash [hash of the actual commit that was tested] ade08c5d9775cac4ebfe2a3f8571dedf299be222
Steps To Reproduce:
(Add details for how we can reproduce the issue)
- Run a docker instance on 0.0.0.0:9876
- Then launch EOS blockchain via docker up
- Note all http calls work normally except wallet specific calls.
Supporting Material/References:
- List any additional material (e.g. screenshots, logs, etc.)
Impact
The risk is on the Block Producer integrity side. The docker instance fails silently if a port is already taken. So a block producer can run a modified instance of keosd with a data logger prior to running docker up as long as the port is taken it will interact normally with the blockchain.
It seems keos can be turned off and on or running before a block producer runs docker up and there is no mechanism to make sure it is the correct copy running with no data logger putting the integrity of that validator at risk.
Docker is no longer the recommended method for installing and running either nodeos or keosd. keosd now defaults to using a Unix socket as well, eliminating the bind problem. If keosd settings are overridden to use a TCP socket, the problem is called out in an error message. Users are expected to heed error messages. Block producers even more so.