lightningd: conceal secret config values in listconfigs
What changed, and why it matters
This commit changes Core Lightning's `listconfigs` RPC command so that several secret or sensitive configuration values are hidden and shown as '...' instead of their real content. Previously, anyone who could call `listconfigs` could see values like the Bitcoin RPC password, wallet database connection string, recovery seed, Tor service password, and old bookkeeper database details. The commit also fixes a bug where concealed options were still being shown when they were not actually set. This is a security hardening change that reduces the risk of leaking credentials to unauthorized callers.
Treat this as a security hardening fix and include it in release notes. Operators should upgrade to prevent accidental credential exposure through `listconfigs` and audit any existing logs or backups that may have captured these values. No immediate incident response is required unless `listconfigs` output has been shared with untrusted parties.
Security signals we found
Concealment of sensitive configuration values in RPC output
Fix for unset concealed options still being exposed
Credential-leak prevention for Bitcoin RPC, wallet DSN, recovery secret, Tor password
Schema documentation updated to reflect concealment behavior
Security-relevant hardening with no functional protocol change
Evidence from the diff
The patch marks --wallet, --recover, --tor-service-password, --bookkeeper-db, and the bitcoin-rpcpassword plugin option with the OPT_CONCEAL / string-conceal flag. In lightningd/configs.c, the get_opt_val function now returns NULL for concealed options when no configvar is present, preventing unset concealed options from appearing in listconfigs output. The JSON schemas and generated schema are updated to document that these values are always concealed. The exposesecret-passphrase example is removed from the schema, likely because it is a separate plugin and not part of core lightningd options. The change is defensive: it limits information disclosure via an authenticated RPC interface.
Changed components
lightningd/configs.clightningd/options.cplugins/bcli.cdoc/schemas/listconfigs.jsoncontrib/msggen/msggen/schema.jsonInspect captured patch +30 / −35
### contrib/msggen/msggen/schema.json
@@ -21109,7 +21109,7 @@
"value_str": {
"type": "string",
"description": [
- "Field from config or cmdline, or default."
+ "Always `...` (the value is concealed)."
]
},
"source": {
@@ -22125,7 +22125,7 @@
"added": "v23.11",
"type": "string",
"description": [
- "Mnemonic or hex secret to restore the node."
+ "Always `...` (the value is concealed)."
]
},
"source": {
@@ -22343,7 +22343,7 @@
"value_str": {
"type": "string",
"description": [
- "Field from config or cmdline, or default."
+ "Always `...` (the value is concealed)."
]
},
"source": {
@@ -22991,7 +22991,7 @@
"plugin": "/usr/local/libexec/plugins/bcli"
},
"bitcoin-rpcpassword": {
- "value_str": "rpcpass",
+ "value_str": "...",
"source": "cmdline",
"plugin": "/usr/local/libexec/plugins/bcli"
},
@@ -23089,11 +23089,6 @@
"sources": [],
"plugin": "/usr/local/libexec/plugins/cln-xpay"
},
- "exposesecret-passphrase": {
- "value_str": "...",
- "source": "default",
- "plugin": "/usr/local/libexec/plugins/exposesecret"
- },
"funder-fund-probability": {
"value_int": 100,
"source": "default",
### doc/schemas/listconfigs.json
@@ -506,7 +506,7 @@
"value_str": {
"type": "string",
"description": [
- "Field from config or cmdline, or default."
+ "Always `...` (the value is concealed)."
]
},
"source": {
@@ -1522,7 +1522,7 @@
"added": "v23.11",
"type": "string",
"description": [
- "Mnemonic or hex secret to restore the node."
+ "Always `...` (the value is concealed)."
]
},
"source": {
@@ -1740,7 +1740,7 @@
"value_str": {
"type": "string",
"description": [
- "Field from config or cmdline, or default."
+ "Always `...` (the value is concealed)."
]
},
"source": {
@@ -2388,7 +2388,7 @@
"plugin": "/usr/local/libexec/plugins/bcli"
},
"bitcoin-rpcpassword": {
- "value_str": "rpcpass",
+ "value_str": "...",
"source": "cmdline",
"plugin": "/usr/local/libexec/plugins/bcli"
},
@@ -2486,11 +2486,6 @@
"sources": [],
"plugin": "/usr/local/libexec/plugins/cln-xpay"
},
- "exposesecret-passphrase": {
- "value_str": "...",
- "source": "default",
- "plugin": "/usr/local/libexec/plugins/exposesecret"
- },
"funder-fund-probability": {
"value_int": 100,
"source": "default",
### lightningd/configs.c
@@ -64,8 +64,9 @@ static const char *get_opt_val(const struct opt_table *ot,
char buf[],
const struct configvar *cv)
{
+ /* Only show that it's set, not the value */
if (ot->type & OPT_CONCEAL)
- return "...";
+ return cv ? "..." : NULL;
if (ot->show == (void *)opt_show_charp) {
/* Don't truncate or quote! */
### lightningd/options.c
@@ -1484,14 +1484,17 @@ static void register_opts(struct lightningd *ld)
/* This immediately makes is a daemon. */
opt_register_early_noarg("--daemon", opt_start_daemon, ld,
"Run in the background, suppress stdout/stderr");
- opt_register_early_arg("--wallet", opt_set_talstr, NULL,
- &ld->wallet_dsn,
- "Location of the wallet database.");
-
- opt_register_early_arg("--recover", opt_set_hsm_secret, NULL,
- ld,
- "Populate hsm_secret with the given codex32/hex/mnemonic secret"
- " and starts the node in `offline` mode.");
+ /* DSN can contain a database password */
+ clnopt_witharg("--wallet", OPT_EARLY|OPT_CONCEAL,
+ opt_set_talstr, NULL,
+ &ld->wallet_dsn,
+ "Location of the wallet database.");
+
+ clnopt_witharg("--recover", OPT_EARLY|OPT_CONCEAL,
+ opt_set_hsm_secret, NULL,
+ ld,
+ "Populate hsm_secret with the given codex32/hex/mnemonic secret"
+ " and starts the node in `offline` mode.");
/* This affects our features, so set early. */
opt_register_early_noarg("--large-channels|--wumbo",
@@ -1612,9 +1615,10 @@ static void register_opts(struct lightningd *ld)
"If true, listen on default port and announce if it seems to be a public interface");
opt_register_arg("--proxy", opt_add_proxy_addr, NULL,
ld,"Set a socks v5 proxy IP address and port");
- opt_register_arg("--tor-service-password", opt_set_talstr, NULL,
- &ld->tor_service_password,
- "Set a Tor hidden service password");
+ clnopt_witharg("--tor-service-password", OPT_CONCEAL,
+ opt_set_talstr, NULL,
+ &ld->tor_service_password,
+ "Set a Tor hidden service password");
clnopt_witharg("--accept-htlc-tlv-type", OPT_MULTI|OPT_SHOWINT,
opt_add_accept_htlc_tlv, NULL,
@@ -1685,10 +1689,10 @@ static void register_opts(struct lightningd *ld)
opt_set_talstr, NULL,
&ld->old_bookkeeper_dir,
opt_hidden);
- opt_register_early_arg("--bookkeeper-db",
- opt_set_talstr, NULL,
- &ld->old_bookkeeper_db,
- opt_hidden);
+ clnopt_witharg("--bookkeeper-db", OPT_EARLY|OPT_CONCEAL,
+ opt_set_talstr, NULL,
+ &ld->old_bookkeeper_db,
+ opt_hidden);
clnopt_witharg("--message-padding", OPT_SHOWBOOL,
opt_set_bool_arg, opt_show_bool,
&ld->message_padding,
### plugins/bcli.c
@@ -896,7 +896,7 @@ int main(int argc, char *argv[])
"bitcoind RPC username",
charp_option, NULL, &bitcoind->rpcuser),
plugin_option("bitcoin-rpcpassword",
- "string",
+ "string-conceal",
"bitcoind RPC password",
charp_option, NULL, &bitcoind->rpcpass),
plugin_option("bitcoin-rpcconnect",Why this scored 65/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.