dcrwallet icon indicating copy to clipboard operation
dcrwallet copied to clipboard

Allow gRPC methods which require unlocked wallet to not specify private passphrase

Open jrick opened this issue 7 years ago • 0 comments

The current design of the gRPC API requires that any action which requires an unlocked wallet provides the wallet's private passphrase in the RPC parameters. This was a design decision to prevent GUI wallet clients which run dcrwallet as a background process from unlocking the wallet for an operation and then leaving the wallet unlocked forever (or longer than necessary) due to some error (such as a problem in the client's logic or even a crash).

While this design has worked out for several years, there are also situations where it is problematic to require the passphrase if physical and networked segmentation is used to isolate an unlocked wallet.

gRPC allows optional client credentials to be provided. These credentials are not currently checked at all, and the requirement of the private passphrase in RPC parameters has prevented malicious clients from causing harm. If the passphrase was not required, because no additional authentication was performed, any client that can call gRPCs would be able to sign transactions or dump private keys while the wallet was unlocked.

To make the private passphrase parameters optional while preventing unauthorized clients from using the unlocked wallet, optional authentication can be added. If the client correctly authenticates, the private passphrase is optional. If the client does not authenticate, then the behavior remains the same as today. This allows the private passphrase arguments to be made optional in a backwards-compatible manner.

jrick avatar Oct 31 '18 17:10 jrick