What changed, and why it matters
This change stops Monero's command-line wallet from writing full command arguments, including passwords or other secrets, to its debug log files. Previously, when a user typed a command with arguments, the entire line could be recorded in logs at the debug level. Now, only the command name is logged, while arguments are stripped out. This reduces the risk that sensitive information accidentally ends up in log files where it could be read later by another user or process.
Users and operators running simplewallet should upgrade to a version containing this commit and review existing debug log files for any accidentally recorded sensitive command arguments. Other tools using epee's console_handler should evaluate whether they also need to call set_log_command_arguments(false).
Security signals we found
Sensitive data may have been written to debug logs before the patch
Patch strips command arguments from debug logging in the wallet
Default behavior in the generic console handler remains unchanged (arguments still logged unless caller opts out)
Change is narrowly scoped to simplewallet's own command handler
Evidence from the diff
The patch adds a configurable flag, m_log_command_arguments, to epee’s console_handler. When set to false, the LOG_PRINT_L2 statement logs only the substring before the first whitespace character (the command name), rather than the full command string including arguments. In simplewallet.cpp, the wallet explicitly calls set_log_command_arguments(false) before entering its command loop. This prevents command arguments, which may include secrets such as passwords or mnemonic phrases, from being written to debug logs.
Changed components
src/simplewallet/simplewallet.cppcontrib/epee/include/console_handler.hMonero simplewallet debug logsInspect captured patch +13 / −1
### contrib/epee/include/console_handler.h
@@ -313,6 +313,11 @@ namespace epee
{
}
+ void set_log_command_arguments(bool log_command_arguments)
+ {
+ m_log_command_arguments = log_command_arguments;
+ }
+
template<class t_server, class chain_handler>
bool run(t_server* psrv, chain_handler ch_handler, std::function<std::string(void)> prompt, const std::string& usage = "")
{
@@ -398,7 +403,7 @@ namespace epee
string_tools::trim(command);
- LOG_PRINT_L2("Read command: " << command);
+ LOG_PRINT_L2("Read command: " << (m_log_command_arguments ? command : command.substr(0, command.find_first_of(" \t\r\n"))));
if(cmd_handler(command))
{
continue;
@@ -430,6 +435,7 @@ namespace epee
async_stdin_reader m_stdin_reader;
std::atomic<bool> m_running = {true};
std::atomic<bool> m_cancel = {false};
+ bool m_log_command_arguments = true;
std::function<std::string(void)> m_prompt;
};
@@ -656,6 +662,11 @@ namespace epee
m_console_handler.stop();
}
+ void set_log_command_arguments(bool log_command_arguments)
+ {
+ m_console_handler.set_log_command_arguments(log_command_arguments);
+ }
+
bool run_handling(std::function<std::string(void)> prompt, const std::string& usage_string, std::function<void(void)> exit_handler = NULL)
{
return m_console_handler.run(std::bind(&console_handlers_binder::process_command_str, this, std::placeholders::_1), prompt, usage_string, exit_handler);
### src/simplewallet/simplewallet.cpp
@@ -9409,6 +9409,7 @@ bool simple_wallet::run()
m_idle_thread = boost::thread([&]{wallet_idle_thread();});
message_writer(console_color_green, false) << "Background refresh thread started";
+ m_cmd_binder.set_log_command_arguments(false);
return m_cmd_binder.run_handling([this](){return get_prompt();}, "");
}
//----------------------------------------------------------------------------------------------------Why this scored 50/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.