config: change message-padding to false by default.
What changed, and why it matters
This change turns off a privacy feature that made all network messages the same size by default. The feature was causing connection problems with some other Lightning nodes that didn't handle the extra padding bytes correctly, and the existing detection of those broken nodes wasn't reliable enough. It is a compatibility and reliability fix, not a security patch for an exploitable vulnerability.
No immediate security action required. Operators who want the traffic-analysis resistance of uniform-length messages should explicitly set `message-padding=true` in their configuration, accepting the risk of connection failures with non-conforming peers.
Security signals we found
Disables a traffic-shaping/privacy countermeasure by default
Interoperability fix for peers that mishandle padded messages
No memory safety, authentication, authorization, or cryptographic changes
Evidence from the diff
The commit changes the default value of the message-padding configuration option from true to false. When enabled, connectd pads Lightning protocol messages so that all transmitted packets are uniform length, which is a traffic-analysis countermeasure. The change was made because too many interoperability issues were reported with non-conforming peers that reject or mishandle the padding, and the heuristic detection of such peers was unreliable. The test for constant packet size is updated to explicitly enable padding so it continues to validate the feature when active.
Changed components
lightningd message-padding defaultconnectd peer message padding behaviordoc/lightningd-config.5.mdtests/test_connection.py::test_constant_packet_sizeInspect captured patch +6 / −6
diff --git a/doc/lightningd-config.5.md b/doc/lightningd-config.5.md
index e85a1a19..ece453d5 100644
--- a/doc/lightningd-config.5.md
+++ b/doc/lightningd-config.5.md
@@ -709,9 +709,9 @@ all DNS lookups, to avoid leaking information.
* **message-padding**=*BOOL*
- Normally `connectd` will send extra bytes to peers to make messages
-uniform length. Some implementations don't accept these extra bytes:
-if we can't detect them, this option sets to `false` will disable it.
+ If set to `true`, `connectd` will send extra bytes to peers to make messages
+uniform length. Some implementations don't accept these extra bytes,
+and our detection of them is not always reliable, so this option defaults to `false`.
* **tor-service-password**=*PASSWORD*
diff --git a/lightningd/lightningd.c b/lightningd/lightningd.c
index cd0d8b05..3e95e59c 100644
--- a/lightningd/lightningd.c
+++ b/lightningd/lightningd.c
@@ -377,7 +377,7 @@ static struct lightningd *new_lightningd(const tal_t *ctx)
/*~ connectd usually uses "no-reply" pings to fill out messages
* where needed to make them uniform length. Some implementations
* don't like it, so it can be disabled. */
- ld->message_padding = true;
+ ld->message_padding = false;
return ld;
}
diff --git a/lightningd/options.c b/lightningd/options.c
index b724b200..c611bdd8 100644
--- a/lightningd/options.c
+++ b/lightningd/options.c
@@ -1671,7 +1671,7 @@ static void register_opts(struct lightningd *ld)
clnopt_witharg("--message-padding", OPT_SHOWBOOL,
opt_set_bool_arg, opt_show_bool,
&ld->message_padding,
- "If true (the default), pad all messages to peers to make them equal length");
+ "If true, pad all messages to peers to make them equal length");
dev_register_opts(ld);
}
diff --git a/tests/test_connection.py b/tests/test_connection.py
index a4ed0c1a..19135be7 100644
--- a/tests/test_connection.py
+++ b/tests/test_connection.py
@@ -4900,7 +4900,7 @@ def test_constant_packet_size(node_factory, tcp_capture):
Test that TCP packets between nodes are constant size. This will be skipped unless
you can run `dumpcap` (usually means you have to be in the `wireshark` group).
"""
- l1, l2, l3, l4 = node_factory.get_nodes(4)
+ l1, l2, l3, l4 = node_factory.get_nodes(4, opts={'message-padding': True})
# Encrypted setup BOLT 8 has some short packets.
l1.connect(l2)
Why this scored 19/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.