Skip to content

Conversation

@achow101
Copy link
Member

@achow101 achow101 commented Sep 16, 2016

Right now passphrases in the debug console are displayed in plaintext on screen as well as in the history. This will replace all the passphrases entered with the walletpassphrase and walletpassphrasechange RPCs with a placeholder, **PASSPHRASE**, in order to prevent the loss of a password due to people looking at the debug console history.

Masks out passphrases with **PASSPHRASE**, **OLDPASSPHRASE**, and **NEWPASSPHRASE** to prevent the loss of passwords from people scrolling through debug console history.
@paveljanik
Copy link
Contributor

There are more of them - like encryptwallet.

@elbandi
Copy link
Contributor

elbandi commented Sep 17, 2016

Is it make sense to put this "masked" commands to history?

@laanwj
Copy link
Member

laanwj commented Sep 19, 2016

Concept ACK

Is it make sense to put this "masked" commands to history?

I like this idea, it would also make the code simpler. Just have a list of 'masked' RPC calls, instead of having to handle the arguments per call.

message(CMD_REQUEST, cmd);
Q_EMIT cmdRequest(cmd);
// Remove passphrases from history
QStringList cmdList = cmd.split(' ');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, splitting on ' ' is not enough here. Arguments can contain spaces if they're surrounded with ' or ". E.g. walletpassphrase "my voice is my password verify me"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't matter since only the command (first in the list) and the timeout (last in the list) are actually needed. Anything else in between doesn't matter.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. What I'm afraid of is that in the future someone is bound to add a command for which this is not true. The handling per command is a bit brittle.

So I'd prefer these commands to not be added to history in the first place.

@jonasschnelli
Copy link
Contributor

Generally concept ACK.

Though, I think we should add a flag (maybe on level of the CRPCTable) that could be used by the QT console to avoid storing a command-line containing one of these "flagged" methods into the local console history.

The flag could be labeled exposeSecrets and could be co-used for other purposed.

@achow101
Copy link
Member Author

achow101 commented Sep 20, 2016

@jonasschnelli @laanwj I will see if I can figure something out for with a flag or lists and not actually checking the arguments in each call. My C++ is not the greatest so I don't know whether I can actually do that.

Edit: I don't think something with CRPCTable would work since the string goes straight to the console window before it is even processed by the rpc server.

@laanwj
Copy link
Member

laanwj commented Sep 20, 2016

Moving this to some kind of table makes sense, however let's not use the CRPCTable for this. It should not contain GUI-level (or in general, client-side) logic. That belongs in rpc/client.cpp or the GUI itself.

@luke-jr
Copy link
Member

luke-jr commented Sep 22, 2016

Probably a good idea to reuse code from #5891

@gmaxwell
Copy link
Contributor

The person reporting this on Bitcointalk is claiming that the history persists across restarts: https://bitcointalk.org/index.php?topic=1618462.0

If that is true there may be other leaks to be concerned about here.

@achow101
Copy link
Member Author

I've been unable to reproduce what he is reporting.

On September 26, 2016 12:50:52 PM Gregory Maxwell
[email protected] wrote:

The person reporting this on Bitcointalk is claiming that the history
persists across restarts: https://bitcointalk.org/index.php?topic=1618462.0

If that is true there may be other leaks to be concerned about here.

You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#8746 (comment)

@laanwj
Copy link
Member

laanwj commented Sep 26, 2016

History does not persist across restarts. There have been proposals for that but I've always been against that. It could be that one of the forks does, but not in Bitcoin Core.

@luke-jr
Copy link
Member

luke-jr commented Sep 27, 2016

The person reporting this on Bitcointalk is claiming that the history persists across restarts:

He's probably running Knots, not Core. Seems off-topic for this PR...

@laanwj
Copy link
Member

laanwj commented Oct 4, 2016

Closing in favor of #8877

@laanwj laanwj closed this Oct 4, 2016
@achow101 achow101 deleted the hide-walletpassphrase branch October 29, 2016 03:33
@achow101 achow101 restored the hide-walletpassphrase branch October 29, 2016 03:34
@achow101 achow101 deleted the hide-walletpassphrase branch April 5, 2017 14:31
@achow101 achow101 restored the hide-walletpassphrase branch April 21, 2017 02:08
@achow101 achow101 deleted the hide-walletpassphrase branch May 17, 2017 16:11
@achow101 achow101 restored the hide-walletpassphrase branch August 17, 2018 21:38
@achow101 achow101 deleted the hide-walletpassphrase branch August 17, 2018 21:40
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants