-
Notifications
You must be signed in to change notification settings - Fork 326
Prevent re-execution of sensitive commands from console history #909
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
base: master
Are you sure you want to change the base?
Prevent re-execution of sensitive commands from console history #909
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
2f59bf6 to
a0422e5
Compare
src/qt/rpcconsole.cpp
Outdated
| "Lines starting with '#' are treated as comments and are not executed.\n" | ||
| " example: # Hello world\n\n"))); | ||
| return; | ||
| } else if (executableCommand.starts_with("#")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably check this before parsing (top of RPCConsole::on_lineEdit_returnPressed)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You’re right, a separate signal/slot wasn’t necessary here. I revisited the implementation, removed both the signal and slot, and consolidated the logic directly into RPCConsole::on_lineEdit_returnPressed, as you suggested, cleaning everything up. Thanks for taking a look at the PR!
a0422e5 to
a87c8ac
Compare
|
a87c8ac to
318eacf
Compare
|
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
318eacf to
48fefa8
Compare
48fefa8 to
02e2787
Compare
|
Extended the blocking filter to include transaction-related RPCs Test covereage added for them |
02e2787 to
5624f73
Compare
5624f73 to
9d7cd51
Compare
Sensitive RPC commands such as
walletpassphraseorcreatewallethave their arguments redacted when stored in the console history.
Even though their parameters are hidden, these commands could still
be recalled and executed again, which might lead to unintended or
harmful actions.
This change extends the existing blocking filter that prevents
re-execution of commands considered sensitive or risky when recalled
from history. Such entries are prefixed with a leading character (
!),marking them as non-executable. When the user attempts to run them
again from history, the console blocks the action and displays an
informational message. Commands entered manually remain unaffected.
In addition to wallet and key-related RPCs, this filter now also
covers transaction-related commands such as
send,sendall,sendmany, andsendtoaddress, which may cause unwanted effectsif repeated from history.
Test coverage has been expanded to verify redaction and blocking
behavior, ensuring that sensitive commands are correctly identified
and prefixed. The console help text has been updated to describe
this functionality.