Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPC test nodes may be on the Internet #4248

Open
solardiz opened this issue Nov 29, 2019 · 4 comments
Open

RPC test nodes may be on the Internet #4248

solardiz opened this issue Nov 29, 2019 · 4 comments
Assignees
Labels
A-rpc-interface Area: RPC interface A-testing Area: Tests and testing infrastructure I-SECURITY Problems and improvements related to security.

Comments

@solardiz
Copy link
Contributor

Zcash's RPC tests spawn test nodes with configuration files like:

regtest=1
showmetrics=0
rpcuser=rt
rpcpassword=rt
port=11994
rpcport=12994
listenonion=0

This results in them being potentially accessible from the Internet - if the system is on the Internet and incoming traffic is not filtered. Combined with the hard-coded RPC password above, this probably allows for at least confusing the tests, and possibly much worse.

I suggest that this be added:

rpcbind=127.0.0.1
rpcallowip=127.0.0.1/32
@solardiz
Copy link
Contributor Author

It would also be nice to generate and use a random password to prevent attacks from the same host, but that's both less important and more work to implement. Please feel free to open a separate issue to track this suggestion as well, if desired.

@daira daira added I-SECURITY Problems and improvements related to security. A-testing Area: Tests and testing infrastructure A-rpc-interface Area: RPC interface labels Dec 1, 2019
@daira daira self-assigned this Dec 1, 2019
@mdr0id
Copy link
Contributor

mdr0id commented Dec 2, 2019

Thank you for submitting this issue, we will change the mentioned params in the config.

@holmesworcester
Copy link

It would also be nice to generate and use a random password to prevent attacks from the same host, but that's both less important and more work to implement.

We're interested in this. Malicious locally running code accessing the user's RPC interface is a security issue we're concerned about for the Zbay wallet. Did another issue get created for this?

@kowalski
Copy link

I'd also like to point out that fix proposed by @solardix does help for attacker using same local network.
However it still doesn't solve a problem with malicious sites.
A malicious code running in the browser may still access localhost:11994 and do harm.

This isn't the case only for test nodes. It's more worrying for mainnet nodes that people are running locally.

An open tcp port is always a security risk.

I think it would be great if it was possible to have rpc interface listening on unix socket instead of tcp socket. In my personal opinion this should be default behavior on Linux and Mac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc-interface Area: RPC interface A-testing Area: Tests and testing infrastructure I-SECURITY Problems and improvements related to security.
Projects
None yet
Development

No branches or pull requests

5 participants