Skip to content

Conversation

@furszy
Copy link

@furszy furszy commented Oct 18, 2020

Another attempt to alert users about scams, added a second confirmation dialog after requesting a dumpwallet or dumpprivkey in the internal GUI wallet console.
Want to emphasize that this is a GUI only change, command line RPC call will continue exactly as before.

After typing dumpwallet, the application will launch the following confirmation dialog:
dumpwallet

So, in other words, the command will only be executed if the user presses "OK" on this "DON'T DO THIS" warning

@furszy furszy self-assigned this Oct 18, 2020
@furszy furszy force-pushed the 2020_double_confirmation_dialog branch from fa1326f to 34b0531 Compare October 18, 2020 16:39
@ambassador000
Copy link

ambassador000 commented Oct 19, 2020

I'm very happy to see this PR, which puts PIVX at the top of the list for caring about less skilled community members.

I've tested this PR, wallet will open a confirmation dialog only when the exact dumpwallet or dumpprivkey commands are typed. It means that when a bad actor trick the victim to type dumpwallet anyKeywordHere, GUI confirmation dialog will be bypassed and proceed with the command execution without the confirmation dialog.

Same thing is with the dumpprivkey command, which should trigger the confirmation dialog opening for dumpprivkey anyKeywordOrAnyReceivingAddressTypedHere command.

So I guess the condition for the confirmation dialog triggering should be if the typed command consist the dumpwallet or dumpprivkey, no matter what was written afterwards.

Copy link

@random-zebra random-zebra left a comment

Choose a reason for hiding this comment

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

It would be better to pop-up the dialog only when the command is entered correctly.
E.g. if you type only dumpwallet, without specifying the filename, the dialog shouldn't be presented, and the console should directly print the help.

But this would require much more invasive changes, and it's a really minor issue (that can be addressed later, if needed).

So ACK 34b0531 from my side.

void clear(bool clearHistory = true);
void message(int category, const QString &msg) { message(category, msg, false); }
void message(int category, const QString &message, bool html);
void response(int category, const QString &message) { messageInternal(category, message); };

Choose a reason for hiding this comment

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

non-blocking nit:
let's call this reply instead of response (for consistency with the RPCExecutor signal)

Copy link
Collaborator

@Fuzzbawls Fuzzbawls left a comment

Choose a reason for hiding this comment

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

utACK 34b0531

@Fuzzbawls Fuzzbawls merged commit 1563253 into PIVX-Project:master Dec 7, 2020
@Fuzzbawls Fuzzbawls added the Needs Release Notes Placeholder tag for anything needing mention in the "Notable Changes" section of release notes label Dec 14, 2020
@random-zebra random-zebra removed the Needs Release Notes Placeholder tag for anything needing mention in the "Notable Changes" section of release notes label Jan 3, 2021
furszy added a commit that referenced this pull request Jan 4, 2021
…expose privkeys

81e4d15 [GUI][RPC] Add exportsaplingkey to the list of pot. dangerous cmds (random-zebra)
1d63d1a [GUI][BUG] Fix confirmation dialog for dumpwallet/dumpprivkey (random-zebra)

Pull request description:

  Fix an issue with the double confirmation dialog introduced in #1928

  Currently the confirmation pop-up is shown only when the RPC command string is exactly "dumpwallet"/"dumpprivkey" (with no arguments).
  Such command strings are not valid, as both RPC functions require one argument (the filename for "dumpwallet" and the PIVX address for "dumpprivkey").

  So, when the user confirms the dialog, the RPC console returns an error (as the argument is missing), showing the RPC help.

  When, instead, the user enters the correct RPC strings (`dumpwallet <filename>`/`dumpprivkey <pivxaddress>`), then **the warning dialog is NOT presented** and the command is executed immediately.

  Fix it by doing a pre-validation for the potentially dangerous commands.
  Bonus: include `exportsaplingkey` to the list.

  Note: for `dumpprivkey`/`exportsaplingkey` this means a double parsing of the command string and decoding of the address argument (one during the pre-validation, and one during the actual execution of the RPC). But I think we can live with that for now.

ACKs for top commit:
  Fuzzbawls:
    ACK 81e4d15
  furszy:
    ACK 81e4d15

Tree-SHA512: 56c004a8771cc1a11b892272c28e68792f4414061dc37450e4e58e60c5e3570e0fd36f5b8bd00535647622ea018ef5947413c3ff67ef7baa3134ae757ea262d7
@furszy furszy deleted the 2020_double_confirmation_dialog branch November 29, 2022 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants