Skip to content

log: mask SENSITIVE rw_settings in LogArgs - #36980

Open
enessubass wants to merge 1 commit into
bitcoin:masterfrom
enessubass:logargs-mask-rw-settings
Open

enessubass wants to merge 1 commit into
bitcoin:masterfrom
enessubass:logargs-mask-rw-settings

Conversation

@enessubass

Copy link
Copy Markdown

ArgsManager::LogArgs masks SENSITIVE options from bitcoin.conf and the command line via logArgsPrefix, but prints m_settings.rw_settings values verbatim. Secrets such as rpcpassword, rpcuser, rpcauth, or torpassword stored in settings.json are therefore written in cleartext to debug.log and startup console output.

Resolve each rw_settings key with InterpretKey and mask its logged value with **** when the registered option carries ArgsManager::SENSITIVE, while preserving existing logging for unknown settings.

Tests:

  • ./build/bin/test_bitcoin --run_test=getarg_tests/logargs
  • ./build/test/functional/feature_settings.py

ArgsManager::LogArgs masked SENSITIVE options from bitcoin.conf and the
command line via logArgsPrefix, but printed m_settings.rw_settings
values verbatim. Secrets such as rpcpassword, rpcuser, rpcauth, or
torpassword stored in settings.json were therefore written in cleartext
to debug.log and startup console output.

Resolve each rw_settings entry with InterpretKey and mask its logged
value with **** when the registered option carries the SENSITIVE flag,
while preserving existing logging for unknown settings.
@DrahtBot

DrahtBot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

External sites

Reviews

See the guideline and AI policy for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #36904 (log: Remove trailing and embedded newlines from log messages by maflcko)
  • #36033 ([wip,nomerge,rfc] build: Require C++23 compiler by maflcko)

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.

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.

2 participants