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

low priority: better defense-in-depth check? #46

Open
bennetyee opened this issue Nov 4, 2021 · 0 comments
Open

low priority: better defense-in-depth check? #46

bennetyee opened this issue Nov 4, 2021 · 0 comments

Comments

@bennetyee
Copy link

https://github.com/starfishlabs/oasis-evm-web3-gateway/blob/101feef8918c5044b7bb9aa98d38cb0e4f37fee6/main.go#L70

The use of grpc.WithInsecure() with a Unix-domain socket (from conf/server.yml) makes sense, since presumably there are no other users on the system who might create the socket (in /tmp/eth-runtime-test though, so any other user-level application could have created it).

It would be better defense-in-depth if

  • We verified that the address is unix:/... and generated warnings otherwise. If we ever configured to go off of the local machine, unless there are some careful datacenter networking level assurances, we should not be using grpc.WithInsecure(). This is a potential foot gun, since due to load we might very well want to do that in the future, especially if, for example, a single "local" grpc server could back several gateway nodes.
  • We used a different path than /tmp -- the /tmp directory is typically empty at boot and sticky, so if ever some other code w/ a different uid (e.g., trojan'd package via a supply-chain attack) runs before the gateway does, then that code could create the path and the unix-domain socket that this code expects, in which case we'd be talking to a bogus source. A directory path that is solely under the control of the net-runner would be better.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant