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

[Qt] Don't add arguments of sensitive command to console window #10093

Merged
merged 1 commit into from May 2, 2017

Conversation

jonasschnelli
Copy link
Contributor

@jonasschnelli jonasschnelli commented Mar 27, 2017

At the moment, we hide sensitive command arguments from the console history but not from the console window.
This tiny change will also hide the arguments from the console window.

Especially for "importmulti", this may be a little bit annoying because if one executes a command with invalid arguments, you need to start type in everything again.

Ideally we would only filter the command if sensitive arguments have been used (complicated to implement).

List of sensitive commands:

const QStringList historyFilter = QStringList()
    << "importprivkey"
    << "importmulti"
    << "signmessagewithprivkey"
    << "signrawtransaction"
    << "walletpassphrase"
    << "walletpassphrasechange"
    << "encryptwallet";

}

@luke-jr
Copy link
Member

luke-jr commented Mar 27, 2017

Why?

@jonasschnelli
Copy link
Contributor Author

Why?

Even if we don't persist the console windows content, one may not want to expose private keys (and the wallet passphrase) on the screen. IMO "shell"-like interpreters should never reveal passwords "on screen" after they have been typed-in.

@fanquake
Copy link
Member

fanquake commented Apr 2, 2017

Quickly tested. Used the same command with both importprivkey("some_key").
Using master (12af74b) command params are displayed on screen.
With this PR (7278537), they are not.
Master:
master

This PR:
10093

@laanwj
Copy link
Member

laanwj commented Apr 11, 2017

Even if we don't persist the console windows content, one may not want to expose private keys (and the wallet passphrase) on the screen. IMO "shell"-like interpreters should never reveal passwords "on screen" after they have been typed-in.

Agree, it is somewhat useful to prevent shoulder-surfing.

Concept ACK.

@ryanofsky
Copy link
Contributor

ACK 7278537.

Code change is trivial. Tested and confirmed it removes arguments onscreen in addition to ones in history (which were already removed before).

@sipa
Copy link
Member

sipa commented May 1, 2017

Lightly-tested ACK.

@jonasschnelli jonasschnelli merged commit 7278537 into bitcoin:master May 2, 2017
jonasschnelli added a commit that referenced this pull request May 2, 2017
…e window

7278537 [Qt] Don't add arguments of sensitive command to console window (Jonas Schnelli)

Tree-SHA512: 3e5aa19a3f157caf383a0fd7dbf9b0d298d31ddaf8e24e3d1a8b913e19f54f3b69e115f98a21f3e3a14e5ccb368b59de061490ed39718299456a04989f8e3366
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 10, 2019
… console window

7278537 [Qt] Don't add arguments of sensitive command to console window (Jonas Schnelli)

Tree-SHA512: 3e5aa19a3f157caf383a0fd7dbf9b0d298d31ddaf8e24e3d1a8b913e19f54f3b69e115f98a21f3e3a14e5ccb368b59de061490ed39718299456a04989f8e3366
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 10, 2019
… console window

7278537 [Qt] Don't add arguments of sensitive command to console window (Jonas Schnelli)

Tree-SHA512: 3e5aa19a3f157caf383a0fd7dbf9b0d298d31ddaf8e24e3d1a8b913e19f54f3b69e115f98a21f3e3a14e5ccb368b59de061490ed39718299456a04989f8e3366
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 10, 2019
… console window

7278537 [Qt] Don't add arguments of sensitive command to console window (Jonas Schnelli)

Tree-SHA512: 3e5aa19a3f157caf383a0fd7dbf9b0d298d31ddaf8e24e3d1a8b913e19f54f3b69e115f98a21f3e3a14e5ccb368b59de061490ed39718299456a04989f8e3366
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 10, 2019
… console window

7278537 [Qt] Don't add arguments of sensitive command to console window (Jonas Schnelli)

Tree-SHA512: 3e5aa19a3f157caf383a0fd7dbf9b0d298d31ddaf8e24e3d1a8b913e19f54f3b69e115f98a21f3e3a14e5ccb368b59de061490ed39718299456a04989f8e3366
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 10, 2019
… console window

7278537 [Qt] Don't add arguments of sensitive command to console window (Jonas Schnelli)

Tree-SHA512: 3e5aa19a3f157caf383a0fd7dbf9b0d298d31ddaf8e24e3d1a8b913e19f54f3b69e115f98a21f3e3a14e5ccb368b59de061490ed39718299456a04989f8e3366
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 11, 2019
… console window

7278537 [Qt] Don't add arguments of sensitive command to console window (Jonas Schnelli)

Tree-SHA512: 3e5aa19a3f157caf383a0fd7dbf9b0d298d31ddaf8e24e3d1a8b913e19f54f3b69e115f98a21f3e3a14e5ccb368b59de061490ed39718299456a04989f8e3366
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 11, 2019
… console window

7278537 [Qt] Don't add arguments of sensitive command to console window (Jonas Schnelli)

Tree-SHA512: 3e5aa19a3f157caf383a0fd7dbf9b0d298d31ddaf8e24e3d1a8b913e19f54f3b69e115f98a21f3e3a14e5ccb368b59de061490ed39718299456a04989f8e3366
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 12, 2019
… console window

7278537 [Qt] Don't add arguments of sensitive command to console window (Jonas Schnelli)

Tree-SHA512: 3e5aa19a3f157caf383a0fd7dbf9b0d298d31ddaf8e24e3d1a8b913e19f54f3b69e115f98a21f3e3a14e5ccb368b59de061490ed39718299456a04989f8e3366
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 14, 2019
… console window

7278537 [Qt] Don't add arguments of sensitive command to console window (Jonas Schnelli)

Tree-SHA512: 3e5aa19a3f157caf383a0fd7dbf9b0d298d31ddaf8e24e3d1a8b913e19f54f3b69e115f98a21f3e3a14e5ccb368b59de061490ed39718299456a04989f8e3366
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 14, 2019
… console window

7278537 [Qt] Don't add arguments of sensitive command to console window (Jonas Schnelli)

Tree-SHA512: 3e5aa19a3f157caf383a0fd7dbf9b0d298d31ddaf8e24e3d1a8b913e19f54f3b69e115f98a21f3e3a14e5ccb368b59de061490ed39718299456a04989f8e3366
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 14, 2019
… console window

7278537 [Qt] Don't add arguments of sensitive command to console window (Jonas Schnelli)

Tree-SHA512: 3e5aa19a3f157caf383a0fd7dbf9b0d298d31ddaf8e24e3d1a8b913e19f54f3b69e115f98a21f3e3a14e5ccb368b59de061490ed39718299456a04989f8e3366
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 14, 2019
… console window

7278537 [Qt] Don't add arguments of sensitive command to console window (Jonas Schnelli)

Tree-SHA512: 3e5aa19a3f157caf383a0fd7dbf9b0d298d31ddaf8e24e3d1a8b913e19f54f3b69e115f98a21f3e3a14e5ccb368b59de061490ed39718299456a04989f8e3366
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 15, 2019
… console window

7278537 [Qt] Don't add arguments of sensitive command to console window (Jonas Schnelli)

Tree-SHA512: 3e5aa19a3f157caf383a0fd7dbf9b0d298d31ddaf8e24e3d1a8b913e19f54f3b69e115f98a21f3e3a14e5ccb368b59de061490ed39718299456a04989f8e3366
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 19, 2019
… console window

7278537 [Qt] Don't add arguments of sensitive command to console window (Jonas Schnelli)

Tree-SHA512: 3e5aa19a3f157caf383a0fd7dbf9b0d298d31ddaf8e24e3d1a8b913e19f54f3b69e115f98a21f3e3a14e5ccb368b59de061490ed39718299456a04989f8e3366
barrystyle pushed a commit to PACGlobalOfficial/PAC that referenced this pull request Jan 22, 2020
… console window

7278537 [Qt] Don't add arguments of sensitive command to console window (Jonas Schnelli)

Tree-SHA512: 3e5aa19a3f157caf383a0fd7dbf9b0d298d31ddaf8e24e3d1a8b913e19f54f3b69e115f98a21f3e3a14e5ccb368b59de061490ed39718299456a04989f8e3366
@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.

None yet

6 participants