log: mask SENSITIVE rw_settings in LogArgs #36980

Open
enessubass wants to merge 1 commit from logargs-mask-rw-settings into master AGit
enessubass commented 2026-11-25 14:07:01 +00:00 (Migrated from github.com)

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` 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`
DrahtBot commented 2026-11-25 14:07:12 +00:00 (Migrated from github.com)

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.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/36980 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36980.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36980#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. A summary of reviews will appear here. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts Reviewers, this pull request conflicts with the following ones: * [#36904](https://github.com/bitcoin/bitcoin/pull/36904) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36904.svg"></sub> (log: Remove trailing and embedded newlines from log messages by maflcko) * [#36033](https://github.com/bitcoin/bitcoin/pull/36033) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36033.svg"></sub> ([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. <!--5faf32d7da4f0f540f40219e4f7537a3-->
First-time contributor

I found no actionable issues in this static review.


Reviewed: 61b9f309e40c · Review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:806938d40e279b6d701b2e78128bb1a09b55193a0b697245a1dce6241d3081c1:3607c760b63c01fb7f1f349adfc3fd0614b148a7df02e42f2f0edc2d448925a1 --> <!-- ralph-base:5ba05739881855cba25c3c05d6f82a61b8a0665f --> <!-- ralph-head:61b9f309e40c4577a138e8cafdf0700d0b7fa921 --> <!-- ralph-case:271f1192f57c386fda9efeebaa29a515d922b26f2a89e25e9987e681a8cc752f --> I found no actionable issues in this static review. <!-- Review tier: sensitive --> --- Reviewed: [`61b9f309e40c`](<https://git.fish.foo/bitcoin/bitcoin/commit/61b9f309e40c4577a138e8cafdf0700d0b7fa921>) · [Review report](<https://review.fish.foo/report/36980-61b9f309e40c4577a138e8cafdf0700d0b7fa921-3123-1.html>) · [Previous reports](<https://review.fish.foo/traces/36980/>) [permalink](<https://review.fish.foo/report/36980-61b9f309e40c4577a138e8cafdf0700d0b7fa921-3123-1.html>)
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!36980
No description provided.